[Tutorial] How to create a vehicle fix command - For Admins
#8

first off i think you have done a decent job,
but I would not compact the code so much,

noobies will have a better time understanding the same code but written

pawn Код:
CMD:afix(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4) //check admin level
    {
        if(!IsPlayerInAnyVehicle(playerid)) //check if they are NOT in a vehicle
        {
            return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");  
        }
        //they are in a vehicle so repaire and send a message
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    }
    else    //they are not an admin so send message saying so
    {
        return SendClientMessage, 0xFFFFFFFF, " **You must be a level 4 admin to use that!");
    }
    return 1;  //also i see no point in a return here when it will never be reached.
}
but line for line like you showed is good.
and comments in the code normally help for the COPIERS lol

all in all good job 7/10
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)