SA-MP Forums Archive
[HELP] Setting Random Player Spawn Locations - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Setting Random Player Spawn Locations (/showthread.php?tid=87781)



[HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

hello i need somebody to help me script a random spawn locations (for all players)

i have tried SO many times and cannot seem to get it right, everytime i try to compile i get 8+ errors and warnings.

can somebody PLEASE write a tutorial of some sort, telling me all the includes, publics, new's and define' i have to put in

thanks all!

PS :: looking at the lvdm script didnt help at all, so dont bother putting that


Re: [HELP] Setting Random Player Spawn Locations - Lewwy - 22.07.2009

pawn Код:
new Float:gRandomSpawns[2][3] = // add one on to each of the numbers to add more options.
{
    {X, Y, Z},
    {X, Y, Z}
};

public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(gRandomSpawns));
    SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
    return 1;
}



Re: [HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

Quote:
Originally Posted by [XG
Lj ]
pawn Код:
new Float:gRandomSpawns[2][3] = // add one on to each of the numbers to add more options.
{
    {X, Y, Z},
    {X, Y, Z}
};

public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(gRandomSpawns));
    SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
    return 1;
}
C:\Users\Chris\Desktop\Server\gamemodes\untitled.p wn(832) : error 001: expected token: "}", but found "{"
C:\Users\Chris\Desktop\Server\gamemodes\untitled.p wn(834) : error 054: unmatched closing brace ("}")
C:\Users\Chris\Desktop\Server\gamemodes\untitled.p wn(834) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

^^^^^^^^^^^on compile, i still dont get it!!

i have added the x, y and z co-ords, but still im SO pissed off it doesnt work, please help!


Re: [HELP] Setting Random Player Spawn Locations - V1ceC1ty - 22.07.2009

no that wont work, you'll get atleast 6 5 errors with that.


Re: [HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

Quote:
Originally Posted by V1ceC1ty
no that wont work, you'll get atleast 6 5 errors with that.
PLEASE HELP THEN!


Re: [HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

if i post my GM, can somebody add the player spawn locations plz?


Re: [HELP] Setting Random Player Spawn Locations - Lewwy - 22.07.2009

Funny you should say that, I don't get any errors.


Re: [HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

well if i post my gm will somebody install it?


Re: [HELP] Setting Random Player Spawn Locations - wilcock33 - 22.07.2009

Quote:
Originally Posted by [XG
Lj ]
Funny you should say that, I don't get any errors.
please, if i post you my GM script, will you install it so i can add my PlayerClass positions??

PLEASE


Re: [HELP] Setting Random Player Spawn Locations - V1ceC1ty - 22.07.2009

your showing him how to do 3 spawns when the exaple only has 2

pawn Код:
gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);