getplayerstate bug
#1

hey guys, i've been trying to make it on my server that if you exit a vehicle during a race, you get kicked out of the race.

The way i've done this was by setting a timer whenever the player joins a race to check if the players state is PLAYER_STATE_ONFOOT every 3 seconds, and if it was ONFOOT then it should kick the player from the race.

well, not so much. instead, it doesn't kick the player when they exit their vehicle. here is my coding

(note: I've tried it as a function and a public, i just get a massive spam of "You exited your vehicle..." in return)

PHP код:
forward ExitVehicleRace(playerid);
stock ExitVehicleRace(playerid)
{
    if(
GetPlayerState(playerid == PLAYER_STATE_ONFOOT))
    {
    
JoinCount--;
    
Joined[playerid] = false;
    
DestroyVehicle(CreatedRaceVeh[playerid]);
    
DisablePlayerRaceCheckpoint(playerid);
    
TextDrawHideForPlayer(playeridRaceInfo[playerid]);
    
CPProgess[playerid] = 0;
    
KillTimer(InfoTimer[playerid]);
    
TogglePlayerControllable(playeridtrue);
    
SetCameraBehindPlayer(playerid);
    
TeleportAllowed[playerid] = 1;
    
SetPlayerPos(playeridposX[playerid], posY[playerid], posZ[playerid]);//
    
SetPlayerFacingAngle(playeridposA[playerid]);                        // savepos and loadpos
    
SetPlayerInterior(playeridInterior[playerid]);                       //
    
SetPlayerVirtualWorld(playeridVirtualWorld[playerid]);//-------------//
    
pInfo[playerid][pRaceExits]++;
    
SendClientMessage(playeridRED,  "You Exited your Vehicle, therefore Disqualifying you from the Race!");
    
KillTimer(ExitVehicleRace(playerid));
    }
    return 
1;

Reply


Messages In This Thread
getplayerstate bug - by tommzy09 - 22.12.2014, 14:20
Re: getplayerstate bug - by biker122 - 22.12.2014, 14:38
Re: getplayerstate bug - by tommzy09 - 22.12.2014, 14:49

Forum Jump:


Users browsing this thread: 2 Guest(s)