• Welcome to Vice City Multiplayer.
 

Location code for pawn

Started by Falcon, January 12, 2010, 07:52:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Falcon


Sephiroth

thanks Falcon, this will help alot of people with learning the language and setting up their own scripts (including me :P) majorly

chn batista

this script just support english ?



sorry for my bad english :)

[AoD]NC

ADD PAWN WIKI! :p

Have just 3 questions:

Quotepublic OnPlayerConnect(playerid)
{
   SetWaterLevel(6.0);
   SetGamespeed(100);
   SetGravity(100);
   GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
   return 1;
}
1. SetGravity & other stuff are working for a SELECTED player, not for all on server?
2. For what do you need GetPlayerName? Doesnt make sense for me if not used in a function rofl
3. And what if i forget return 1?

-TriX-

1.Work for all
2.GetPlayer name is the definition of event getplayername when somebody join the server for others use
3.If u dont put return1 the Event will be not finished yet


www.life-urban.co.cc

[AoD]NC

Aww thx Trix :). But i still dont understand why the gravity should be always changed to 100 for all, when a player joins :/.

SilenusShar

thankyou falcon, this is perfect. (apart that i had to spend a day trying to find it)

would you issue it with the linux/window server thats on the main vice city multiplayer site please, because the script released there is different to this one, and no one can create areas unless they have this, but they have to spend days looking for it :-(

Ettans

Quote from: [AoD]NC on January 14, 2010, 06:47:45 PM
Aww thx Trix :). But i still dont understand why the gravity should be always changed to 100 for all, when a player joins :/.

I don't think you have to, as it's not player specific. Changing it to 100 at OnGameModeInit should be enough, although I fail to understand why you have to set it anyway? Isn't the default gravity value 100?

Boss

Quote from: Ettans on February 07, 2010, 08:19:19 AM
I fail to understand why you have to set it anyway? Isn't the default gravity value 100?
It is a default mode, upon which most people base their scripts. Don't you think it will be easier for them just to change that value instead of finding the corresponding function in the list and then figuring out where to put it?

And, yes, setting gravity in OnPlayerConnect is not neccessary.

Ettans

You could also make the code a lot shorter and easier to modify, by using one single array for the location names and coordinates.


enum zMain
{
    name[64],
    Float:area[6]
};



static const zones[][zMain] =
{
    {"Starfish Island",{-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
    {"Ammunation-North-Point-Mall",{-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
    {"VC International",{-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}}
};


Note: The coordinates used in this array are random.

RhinceCalsaac

ettans, thankyou, would you make it in a .pwn file for me

Ettans

You'd have to do it yourself, as you'll need to use the location name, xmin,ymin,zmin,xmax,ymax and zmax from Falcon's code and place it one single array, like I showed. Alternatively you can convert the zone data yourself, I believe it's in a .dat file somewhere in GTA Vice City folder. Most likely zon.dat or zone.dat, or something similar.

-TriX-

Quote from: [AoD]NC on January 14, 2010, 06:47:45 PM
Aww thx Trix :). But i still dont understand why the gravity should be always changed to 100 for all, when a player joins :/.
If you need help i can script a cmd to change gravity ingame  ;D


www.life-urban.co.cc

SilenusShar

You learn something new everyday! i didnt know all were in zone.dat. thanks!

[AoD]NC

@Trix: the only what i want to now is WHY the gravity should be changed every time. WHY?