[HELP] Rank system not working
#1

Hello, i am working in a pilot server (more for hydras/milletary operations etc) and i wanted to create a
rank system for the vehicles. I want the hydras etc only avaible after you passed some missions.

Now i made this filterscript that reads the score and it was supposed to eject the player out of the vehicle if his rank isnt high enough. But it doesnt show up anything/eject the player.

There are no errors/warnings

Script: http://pastebin.com/Rahz6nGx
Reply
#2

OnPlayerEnterVehicle-callback gets called instantly when player presses ENTER, so the player isn't yet in the vehicle, which means RemovePlayerFromVehicle obviously isn't working.

You could either slap (freeze?) the player instead, or try and use OnPlayerStateChange-callback.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER) // When this is called, the player is sitting in the vehicle.
    {
        switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
        {
            case 520, 447, 425: //army
            {
                if(GetPlayerScore(playerid) < 1000)
                {
                    RemovePlayerFromVehicle(playerid);
                    GameTextForPlayer(playerid,"You dont have enough score (1000) to fly this vehicle!",6,6500);
                }
            }
            // Rest of the code...
        }
        // Rest of the code...
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Finn
Посмотреть сообщение
OnPlayerEnterVehicle-callback gets called instantly when player presses ENTER, so the player isn't yet in the vehicle, which means RemovePlayerFromVehicle obviously isn't working.

You could either slap (freeze?) the player instead, or try and use OnPlayerStateChange-callback.
...
Thanks! it works now
I also changed the textdraw anyways (made little mistake + wrong style)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)