Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by Carlton
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2) {
if(GetPlayerVehicleID(playerid) == THE_VEHICLE_VARIABLE_YOU_PLACED) {
if(GetPlayerScore(playerid) < THE_SCORE_YOU_WANT_FOR_THE_VEHICLE +1) return RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
This will consume too much CPU ussage, best is like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(GetPlayerScore(playerid) < 5 && GetPlayerVehicleID(playerid) == Vehicles[1] || Vehicles[2])//And so on... { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this vehicle!"); SetPlayerPos(playerid, x, y, z+1.5); } return 1; }
|
EDIT:
Lol, I forgotted something , now ill work.
|
You're saying a example as if someone's computer is 20mb ram or something. It won't be that much, and if you read what he laser50 said, he said each vehicles has their own score needed to enter the vehicle.