Team Cars Problem!
#1

Team Cars Problem! Everything is compiling and i think it works but it doesnt WORK!
I think problem is somewhere in PlayerStateChange help me :<
Pastebin
pawn Код:
#define CORLEONE 3

enum TeamCars
{
    Corleone
}
new Cars[TeamCars];

Cars[Corleone] = CreateVehicle(545,488.6407,-1498.9587,20.2783,351.7271,0,0,120); // Corleone Car 1

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Corleone])
        {
            if(gTeam[playerid] == CORLEONE)
            {
                SendClientMessage(playerid,COLOR_GREEN, "You are now driving the Grove Car!");
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
Reply
#2

why you can't see example in some gamemode script?
Reply
#3

the check needs to be like this
pawn Код:
if(CarCheck == Cars[CORLEONE])//your team is "CORLEONE" as defined
{
    if(gTeam[playerid] != 1) return SendClientMessage(playerid,-1,"Not team car!");
    //if its a players team car just continue with the script
    SendClientMessage(playerid,-1,"Your driving CORLEONE team's car");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)