Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => ShowRoom (pawn) => Topic started by: Falcon on January 12, 2010, 08:52:42 AM

Title: Location code for pawn
Post by: Falcon on January 12, 2010, 08:52:42 AM
Made location script for pawn.

http://vicecitymultiplayer.com/dl.php?f=13

Hope it helps you guys out.
Title: Re: Location code for pawn
Post by: Sephiroth on January 12, 2010, 10:31:51 AM
thanks Falcon, this will help alot of people with learning the language and setting up their own scripts (including me :P) majorly
Title: Re: Location code for pawn
Post by: chn batista on January 12, 2010, 03:19:29 PM
this script just support english ?



sorry for my bad english :)
Title: Re: Location code for pawn
Post by: [AoD]NC on January 12, 2010, 04:11:42 PM
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?
Title: Re: Location code for pawn
Post by: -TriX- on January 13, 2010, 05:45:06 PM
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
Title: Re: Location code for pawn
Post by: [AoD]NC on January 14, 2010, 07: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 :/.
Title: Re: Location code for pawn
Post by: SilenusShar on February 07, 2010, 01:37:59 AM
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 :-(
Title: Re: Location code for pawn
Post by: Ettans on February 07, 2010, 09:19:19 AM
Quote from: [AoD]NC on January 14, 2010, 07: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?
Title: Re: Location code for pawn
Post by: Boss on February 07, 2010, 01:49:21 PM
Quote from: Ettans on February 07, 2010, 09: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.
Title: Re: Location code for pawn
Post by: Ettans on February 07, 2010, 02:08:38 PM
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.
Title: Re: Location code for pawn
Post by: RhinceCalsaac on February 07, 2010, 02:11:09 PM
ettans, thankyou, would you make it in a .pwn file for me
Title: Re: Location code for pawn
Post by: Ettans on February 07, 2010, 02:13:07 PM
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.
Title: Re: Location code for pawn
Post by: -TriX- on February 07, 2010, 02:16:09 PM
Quote from: [AoD]NC on January 14, 2010, 07: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
Title: Re: Location code for pawn
Post by: SilenusShar on February 07, 2010, 04:46:31 PM
You learn something new everyday! i didnt know all were in zone.dat. thanks!
Title: Re: Location code for pawn
Post by: [AoD]NC on February 07, 2010, 07:49:47 PM
@Trix: the only what i want to now is WHY the gravity should be changed every time. WHY?
Title: Re: Location code for pawn
Post by: Ettans on February 07, 2010, 07:58:02 PM
You don't have to, it's pointless.
Title: Re: Location code for pawn
Post by: BCKLUP on March 14, 2010, 03:18:53 AM
Quote from: Ettans on February 07, 2010, 02:08:38 PM
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.

You can do that but Then Newbies won't understand it easily
i'm quite new with these arrays you put, could anyone please tell me how to check if someone is inside the boundaries of these locs?
Title: Re: Location code for pawn
Post by: Charleyutton on January 26, 2011, 11:54:23 PM
Any mirrors for this?
Title: Re: Location code for pawn
Post by: shivambansal on January 27, 2011, 03:28:19 AM
thanks ;D
Title: Re: Location code for pawn
Post by: Aaron on January 27, 2011, 04:35:21 PM
looking for a re up please :)
Title: Re: Location code for pawn
Post by: BaSSMaN on February 25, 2011, 10:31:29 PM
The link isn't working, can you post a new one?
Title: Re: Location code for pawn
Post by: Robd on February 25, 2011, 11:27:27 PM
for getting location for a command to decide if a player is close enough to an object I just use GetPlayerDistance
Title: Re: Location code for pawn
Post by: aXXo on February 26, 2011, 04:06:44 PM
I think the same location code is present in GUPS script.
You can extract it from GUPS.

Oh btw, i see some year old posts on previous page.
You have to set grav and speed onPlayerConnect because theres a bug in VCMP, that resets normal grav/speed whenever a new player joins the server.
Title: Re: Location code for pawn
Post by: Robd on March 27, 2011, 07:23:47 AM
If it resets itself then why would you need to reset it yourself?
Title: Re: Location code for pawn
Post by: yazeen on March 27, 2011, 02:19:45 PM
please Re-upload linnk its not working  :(:(
Title: Re: Location code for pawn
Post by: tato on March 27, 2011, 06:17:15 PM
Quote from: yazeen on March 27, 2011, 02:19:45 PM
please Re-upload linnk its not working  :(:(
YEAH PLZ