[HELP] Many private cars
#1

How can I make this code more private cars?

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
pname[MAX_PLAYER_NAME];
    new 
car;
    
car AddStaticVehicle(437,-709.94384766,912.88665771,12.69688034,90.00000000,-1,3);
    
GetPlayerName(playeridpnamesizeof pname);
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
vehicleid == car)
        {
            if(
strcmp(pname"Name"true) == 0)
              {
                return 
1;
            }
            else
              {
              
RemovePlayerFromVehicle(playerid);
            new 
string[50];
            
format(stringsizeof(string), "~r~This car is private!");
            
GameTextForPlayer(playeridstring30004);
            }
        }
}
    return 
1;

To not do so on each machine:
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
pname[MAX_PLAYER_NAME];
    new 
car2;
    
car2 AddStaticVehicle(437,-709.94384766,912.88665771,12.69688034,90.00000000,-1,3);
    
GetPlayerName(playeridpnamesizeof pname);
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
vehicleid == car2)
        {
            if(
strcmp(pname"Name"true) == 0)
              {
                return 
1;
            }
            else
              {
              
RemovePlayerFromVehicle(playerid);
            new 
string[50];
            
format(stringsizeof(string), "~r~This car is private!");
            
GameTextForPlayer(playeridstring30004);
            }
        }
}
    return 
1;

Reply


Messages In This Thread
[HELP] Many private cars - by agreathon - 28.07.2011, 09:51
Re: [HELP] Many private cars - by Basicz - 28.07.2011, 10:01
Re: [HELP] Many private cars - by agreathon - 28.07.2011, 10:25
Re: [HELP] Many private cars - by agreathon - 28.07.2011, 10:54
Re: [HELP] Many private cars - by (SF)Noobanatior - 28.07.2011, 11:04
Re: [HELP] Many private cars - by Basicz - 28.07.2011, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)