So I have trouble with my veh system...
#1

here is some code :

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[GroveStreet])
        {
            if (Group_GetPlayer(gGSF, playerid)) // Can use the car.
            {
                SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
                RemovePlayerFromVehicle(playerid);
            }
            return 1;
        }
        if(CarCheck == Cars[SevileCrips])
        {
            if (Group_GetPlayer(gSBF, playerid)) // Can use the car.
            {
                SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You aren't in team Sevile Beach Crips");
                RemovePlayerFromVehicle(playerid);
            }
            return 1;
        }
        if(CarCheck == Cars[VeronaBeachCrips])
        {
            if (Group_GetPlayer(gVBF, playerid)) // Can use the car.
            {
                SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You aren't in Verona Beach Crips");
                RemovePlayerFromVehicle(playerid);
            }
            return 1;
        }
        if(CarCheck == Cars[TempleDriveCrips])
        {
            if (Group_GetPlayer(gTDF, playerid)) // Can use the car.
            {
                SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You aren't in Temple Drive Crips");
                RemovePlayerFromVehicle(playerid);
            }
            return 1;
        }
    }
    return 1;
}
Maybe someone can help.. It dosn't show message when player is driver!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)