Command help
#1

how can i do this so if a player do like /skin 2 his skin will be set to 2

if he type /skin only, the menu will show up

pawn Код:
{
    new pID;
    new skinid;
    if(sscanf(params, "d", skinid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /skin (Skin ID) - Enter A Valid Skin ID");
    if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(GetPVarInt(playerid, "IsSpecing") == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Spectating.");
    if(GetPVarInt(playerid, "IsFrozen") == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Frozen.");
    if(GetPVarInt(playerid, "IsCaged") == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Caged.");
    if(GetPVarInt(playerid, "IsJailed") == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Jailed.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command From A Vehicle.");
    if(sscanf(params, "u", pID))
    {
        if(skinid > 299 || skinid < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID.");
        if(skinid == GetPlayerSkin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Already Have This Skin.");
        if(skinid == 294 || skinid == 0) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Choose This Skin.");
        SetPlayerSkin(playerid, skinid);
    }
    else
    {
        ShowModelSelectionMenu(playerid, skinlist, "Select A Skin", 0, 1 , 0);
    }
    return 1;
}
Reply


Messages In This Thread
Command help - by Ananisiki - 21.03.2014, 19:30
Re: Command help - by CroM256 - 21.03.2014, 20:03
Re: Command help - by Equuuuin0X - 22.03.2014, 00:04
Re: Command help - by Ananisiki - 22.03.2014, 06:56
Re: Command help - by Ananisiki - 22.03.2014, 08:43
Re: Command help - by Stinged - 22.03.2014, 08:54
Re: Command help - by Ananisiki - 22.03.2014, 08:55
Re: Command help - by Ananisiki - 23.03.2014, 03:34
Re: Command help - by Hanuman - 23.03.2014, 03:51
Re: Command help - by Ananisiki - 23.03.2014, 05:22

Forum Jump:


Users browsing this thread: 1 Guest(s)