Cars enterable for certain Scores Only
#7

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