[Tutorial] Making /setarmour command
#8

Quote:
Originally Posted by Remba031
View Post
Code:
CMD:setarmour(playerid, params)
{
    if(IsPlayerAdmin(playerid))
    {
         new id, armour;
         if(sscanf(params, "ui", id, armour)) return SendClientMessage(playerid, "[USE]: /setarmour [ID] [ARMOUR]");
         if(!IsPlayerConnected(id)) return SendClientMessage(playerid, "Player don't Connected");
         if(armour > 0 || armour < 100) return SendClientMessage(playerid, "Use numbers 0-100");
         SetPlayerArmour(id, armour);
         new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME], String[128];
         GetPlayerName(playerid, Name1, sizeof(Name1));
         GetPlayerName(id, Name2, sizeof(Name2));
         format(String, sizeof(String), "The Admin %s set armour %i of %s ",Name1, Armour, Name2);
         SendClientMessageToAll(-1, String);
         return 1;
    }
    else
    {
         SendClientMessage(playerid,-1,"SERVER: You are not logged in to RCON.");
    }
    return 1;
}
pawn Code:
CMD:setarmour(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERROR]: You don't have permission");
    new id, armour, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME], String[128];
    if(sscanf(params, "ui", id, armour)) return SendClientMessage(playerid, "[USE]: /setarmour [ID] [ARMOUR]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, "Player don't Connected");
    if(armour > 0 || armour < 100) return SendClientMessage(playerid, "Use numbers 0-100");
    SetPlayerArmour(id, armour);
    GetPlayerName(playerid, Name1, sizeof(Name1));
    GetPlayerName(id, Name2, sizeof(Name2));
    format(String, sizeof(String), "The Admin %s set armour %i of %s ",Name1, Armour, Name2);
    SendClientMessageToAll(-1, String);
    return 1;
}
Reply


Messages In This Thread
Making /setarmour command - by Trollerz - 27.11.2014, 04:55
Re: Making /setarmour command - by Jonggol - 27.11.2014, 04:57
Re: Making /setarmour command - by Trollerz - 27.11.2014, 05:00
Re: Making /setarmour command - by SydthTV - 27.11.2014, 05:02
Re: Making /setarmour command - by Trollerz - 27.11.2014, 05:06
Re: Making /setarmour command - by PedexM - 27.11.2014, 12:20
Re: Making /setarmour command - by Remba031 - 13.12.2014, 10:19
Re: Making /setarmour command - by PedexM - 13.12.2014, 13:32
Re: Making /setarmour command - by Glossy42O - 13.12.2014, 13:51

Forum Jump:


Users browsing this thread: 2 Guest(s)