Check if player is on the ground>?
#1

hi i want to make a sumo server only how can check if sombody if off the ring( hits the ground ) instead of in the air on the object?

And another question, if a player dies how can i make his vehicle go away( same goes for spawn how can i give him a car :P )

ty !!!
Reply
#2

1. use a timer and IsPlayerInCube (search for it).


2. put this on top of script
pawn Код:
new playerVeh[MAX_PLAYERS]; = -1
then do in OnPlayerStateChange:

pawn Код:
//spawning
if(newstate == PLAYER_STATE_SPAWNED)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    playerVeh[playerid] = CreateVehicle(model, x+2, y, z+0.5, 0, -1, -1, -1); //Change model
}

Then do
pawn Код:
public OnPlayerDeath(playerid, killerid, reason);
{
    if(playerVeh[playerid] > -1)
        DestroyVehicle(playerVeh[playerid]);
    return true;
}
Reply
#3

Код:
new playerVeh[MAX_PLAYERS]; = -1
returns:
J:\Documents and Settings\Administrator\Bureaublad\sumo.pwn(3) : error 010: invalid function or declaration
J
Reply
#4

(removed)
Reply
#5

I forgot that it didn't return any ids, sorry
If you'd use AddStaticVehicle, you couldn't have 0 as default value, since 0 is a ID
Reply
#6

Quote:
Originally Posted by hipy
Код:
new playerVeh[MAX_PLAYERS]; = -1
returns:
J:\Documents and Settings\Administrator\Bureaublad\sumo.pwn(3) : error 010: invalid function or declaration
J
Because it's supposed to be:
pawn Код:
new playerVeh[MAX_PLAYERS] = -1;
Reply
#7

Omg... Why didn't I see that one :P
It was just a little typ0, so it should work the way I gave it to you.
If you're just using new playerVeh[MAX_PLAYERS]; you MUST change if(playerVeh[playerid] > -1) to if(playerVeh[playerid] > 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)