I suck at indenting! D:
#8

pawn Код:
new MyCars[5];
//Example
public OnGameModeInit()
{
    MyCars[0] = CreateVehicle;
    MyCars[1] = CreateVehicle;
    Etc
   
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(MyCars); i++)
        {
            if(vid == MyCars[i])
            {
                if(strcmp(name, "YourName", true))
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, -1, "Only YourName can enter this car!");
                    return 1;
                }
            }
        }
    }
    return 1;
}
That should work, untested though.

Keep in mind its an example though, like no cars are being created
Reply


Messages In This Thread
I suck at indenting! D: - by Shockey HD - 28.07.2011, 02:43
Re: I suck at indenting! D: - by PrawkC - 28.07.2011, 02:49
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 02:51
Re: I suck at indenting! D: - by PrawkC - 28.07.2011, 02:52
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 02:54
Re: I suck at indenting! D: - by PrawkC - 28.07.2011, 02:58
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 03:01
Re: I suck at indenting! D: - by PrawkC - 28.07.2011, 03:09
Re: I suck at indenting! D: - by dowster - 28.07.2011, 03:24
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 03:25
Re: I suck at indenting! D: - by dowster - 28.07.2011, 03:27
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 03:29
Re: I suck at indenting! D: - by dowster - 28.07.2011, 03:35
Re: I suck at indenting! D: - by Shockey HD - 28.07.2011, 03:40
Re: I suck at indenting! D: - by dowster - 28.07.2011, 04:30

Forum Jump:


Users browsing this thread: 1 Guest(s)