Simple help me please
#1

hey guys this is the function i am creating it

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == 520)
    {
      if(!pRank[playerid] = 3; SendClientMessage(playerid, 0xFF0000FF, "You need to be Level: 3 to use this vehicle");
    }
    return 1;
}
And when player enter hydra it show him that message you need to be level 3 to use this vehicle.

I got actually ranks in my script.

so i want to set this hydra only for rank 3


thanks
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 && newstate == 2) {
        if(pRank[playerid] != 3) {
            SendClientMessage(playerid, 0xFF0000FF, "You need to be Level: 3 to use this vehicle");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
The code above will work if the player is only level 3, if you want to check if the player is level 3 or higher, use this code:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 && newstate == 2) {
        if(pRank[playerid] >= 3) {
            SendClientMessage(playerid, 0xFF0000FF, "You need to be Level: 3 to use this vehicle");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Reply
#3

Its not working, When i enter nothing.
Reply
#4

What's the value of your 'pRank'? Also, just copy the code from OnPlayerStateChange in to your current OnPlayerStateChange callback, instead of just copying all of the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)