fixed
#10

No offence, but if you don't know /flip, or /fix, then I'd rather you to get a /fix and /flip with strcmp, which I got for you.
Its easy to understand for beginners, only its a bit bigger.


The /fix (/repair) command - both types of command will work in the same strcmp
pawn Код:
if(!strcmp(cmd, "/repair", true, 7) || strcmp(cmd, "/fix", true, 4) == 0)
        {
        new Float:vehhealth;
        new veh;
        veh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(veh, vehhealth);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"ERROR: not in a vehicle!");
        if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to repair the vehicle");
            SetVehicleHealth(veh,1000);
            RepairVehicle(veh);
            SendClientMessage(playerid, COLOR_GREEN,"You have repaired your vehicle");
            return 1;
        }
The /flip command
pawn Код:
if(strcmp("/flip", cmdtext, true) == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"ERROR: not in a vehicle!");
            if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to flip the vehicle");
        new vehicle;
        new Float:angle;
        vehicle  = GetPlayerVehicleID(playerid);
        GetVehicleZAngle(vehicle, angle);
        SetVehicleZAngle(vehicle, angle);
            SendClientMessage(playerid, COLOR_GREEN, "You have flipped your vehicle");
            return 1;
        }
Reply


Messages In This Thread
fixed - by Kar - 23.06.2010, 17:49
Re: fix and flip command not working ingame - by CAR - 23.06.2010, 17:53
Re: fix and flip command not working ingame - by Kar - 23.06.2010, 18:12
Re: fix and flip command not working ingame - by Anthony_Brassi - 23.06.2010, 18:19
Re: fix and flip command not working ingame - by Kar - 23.06.2010, 18:20
Re: fix and flip command not working ingame - by CAR - 23.06.2010, 18:26
Re: fix and flip command not working ingame - by dice7 - 23.06.2010, 18:27
Re: fix and flip command not working ingame - by DJDhan - 23.06.2010, 18:40
Re: fix and flip command not working ingame - by Kar - 23.06.2010, 18:57
Re: fixed - by MastahServers - 23.06.2010, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)