[HELP] Setting Random Player Spawn Locations
#1

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
Reply
#2

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;
}
Reply
#3

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!
Reply
#4

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

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

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

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

well if i post my gm will somebody install it?
Reply
#9

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
Reply
#10

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)