I can't seem to get the coords working
#1

This is where I want the person to spawn when they die AddPlayerClass(285,185.6111,1929.7433,17.7739,177. 7806,0,0,0,0,0,0); //

Heres the code public OnPlayerDeath( playerid, killerid, reason )
{
SendDeathMessage( killerid, playerid, reason );
SetPlayerPos( playerid, 2134.5957,1332.6907,10.8251 );

But if I enter the coords there I just get errors, I heard you were suppose to only use certain ones but I'm just a noob.
I got the coords from "savedpostions" btw. I'd also like the person to spawn at 3 different places in Las Venturas so people have a chance of fighting back! Thanks a lot!!
Reply
#2

It's not a good idea to use SetPlayerPos under OnPlayerDeath because it will have no effect. You should use it under OnPlayerSpawn. For random spawns you gotta use the function random. Example:
pawn Код:
public OnPlayerSpawn(playerid) // called when a player spawns
{
    new randSpawn = random(3); // gets a pseudo-random number from 0 to 2.
    switch(randSpawn)
    {
        case 0: // if random generated 0
        {
            // Put your first spawn code.
        }
        case 1: // if random generated 1
        {
            // Put your second spawn code.
        }
        case 2: // if random generated 2
        {
            // Put your third spawn code.
        }
    }
    return 1;
}
Reply
#3

Yea but it's 285,185.6111,1929.7433,17.7739,177. 7806,0,0,0,0,0,0); // that I have trouble of finding the coords (this is area 51)
Reply
#4

You only need the 2nd, 3rd and 4th parameters of AddPlayerClass, (185.6111, 1929.7433, 17.7739) are what you need:

pawn Код:
X: 185.6111
Y: 1929.7433
Z: 17.7739
This is how you use them in SetPlayerPos
pawn Код:
SetPlayerPos(playerid, 185.6111, 1929.7433, 17.7739);
Reply
#5

Next time just use /rs (raw save) instead of /save if you're having trouble identifying. This wil only get the players x, y, z and facing angle, in that order and in a separate file.
Reply
#6

I got it, thanks a ton.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)