Cars enterable for certain Scores Only
#4

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.
Reply


Messages In This Thread
Cars enterable for certain Scores Only - by laser50 - 10.03.2010, 20:28
Re: Cars enterable for certain Scores Only - by Carlton - 10.03.2010, 20:31
Re: Cars enterable for certain Scores Only - by 02manchestera - 10.03.2010, 20:31
Re: Cars enterable for certain Scores Only - by Fedee! - 10.03.2010, 20:35
Re: Cars enterable for certain Scores Only - by Torran - 10.03.2010, 20:37
Re: Cars enterable for certain Scores Only - by 02manchestera - 10.03.2010, 20:42
Re: Cars enterable for certain Scores Only - by Carlton - 10.03.2010, 20:52
Re: Cars enterable for certain Scores Only - by Fedee! - 10.03.2010, 20:55
Re: Cars enterable for certain Scores Only - by Carlton - 10.03.2010, 20:56
Re: Cars enterable for certain Scores Only - by laser50 - 10.03.2010, 21:13

Forum Jump:


Users browsing this thread: 2 Guest(s)