Change in cmd
#1

i have a flip cmd but its not that much of pro for example if the passenger does /flip it does flip so can you help me so it only flips if the driver does it?
here is the one i have now
pawn Код:
if(strcmp(cmdtext, "/flip", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new currentveh;
            currentveh = GetPlayerVehicleID(playerid);
            if(GetVehicleModel(currentveh) == 519 || GetVehicleModel(currentveh) == 520)
            SendClientMessage(playerid, -1, "You cannot do this in an airplane");
            }
                new Float:angle;
                GetVehicleZAngle(currentveh, angle);
                SetVehicleZAngle(currentveh, angle);
                SendClientMessage(playerid, COLOR_GREEN, "Your vehicle has been flipped.");
            }
            return 1;
    }
Reply
#2

if(GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
Reply
#3

where should i add it? like can you tell me the cmd fully?
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/flip", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid)&&GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new currentveh, Float:angle;
        currentveh = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(currentveh) == 519 || GetVehicleModel(currentveh) == 520) return SendClientMessage(playerid, -1, "You cannot do this in an airplane");
        GetVehicleZAngle(currentveh, angle);
        SetVehicleZAngle(currentveh, angle);
        SendClientMessage(playerid, COLOR_GREEN, "Your vehicle has been flipped.");
        return 1;
    }
}
Reply
#5

pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
worked thanks so much man +1 for both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)