Team car's. Rep +
#1

Hello guys, I'm working on my drifting/RP server and now it's time to make team's.
I have created police, drifter and mafia and they work fine. But now I want them to have cars.
This is what I have:
pawn Код:
new Cars[TeamCars];

enum TeamCars
{
Drifter,
Cops
}

public OnGameModeInit()
{
    AddPlayerClass(105,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // 0
    AddPlayerClass(282,1607.0870,1815.6981,10.8203,193.8336,0,0,0,0,0,0);
    AddPlayerClass(29,1124.0724,-2037.0490,69.8852,270.1483,0,0,0,0,0,0);
    Cars[Drifter] = AddStaticVehicle(562,1244.0070,-2042.9696,59.5858,1.3234,17,1); // bil
      Cars[Cops] = AddStaticVehicle(596,1244.1085,-2063.5588,59.7767,287.2261,0,0);

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate && 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Cops] )
        {
            if(gTeam[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You cant' drive this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[Drifter] )
        {
            if(gTeam[playerid] != 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You can't drive this car!");
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
And it seems to work but when im a drifter and enter a elegy I get kicked out and when I enter a police car I don't get kicked out. Please help!
Reply


Messages In This Thread
Team car's. Rep + - by Karl[NDZ] - 02.05.2012, 17:50
Re: Team car's. Rep + - by HDFord - 02.05.2012, 20:02
Re : Team car's. Rep + - by Karl[NDZ] - 03.05.2012, 17:48

Forum Jump:


Users browsing this thread: 1 Guest(s)