Score Vehicle Pass [NEED HELP]
#1

Ok now, I want to create this. I have put rhino's and hunter's in-game at my server for the army, but I want players with the score 500 or more to use it and If their score is less than 500, they are removed from the Hunter/Tank.How do I do that?
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 432)
    {
        if(GetPlayerScore(playerid) < 500)
        {
            SetVehicleParamsForPlayer(vehicleid, playerid, false, true);
        }
    }
    return 1;
}
Try this.
Reply
#3

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicle(playerid)) == 432 ||  GetVehicleModel(GetPlayerVehicle(playerid)) == 425)
    {
        if(GetPlayerScore(playerid) < 500)
        {
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by AeroBlast
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicle(playerid)) == 432 ||  GetVehicleModel(GetPlayerVehicle(playerid)) == 425)
    {
        if(GetPlayerScore(playerid) < 500)
        {
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Would recommend my way.
Reply
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 432)
    {
        if(GetPlayerScore(playerid) < 500)
        {
            TogglePlayerControllable(playerid,0);
            TogglePlayerControllable(playerid,1);
        }
    }
    return 1;
}
I prefer that IMHO...

anyways I'll explain what others will do:

1st one will stop the engine for the specific player when they pretty much press the enter button...
2nd one will let the player step out the car right after he entered the car and closed the door
my way will just stop the player from entering when he presses enter...

I think the 2nd one is the most acurate still I prefer my way...
Reply
#6

The best way is either returning 0 or sending a message.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)