What's wrong with this name on/off cmd
#1

It doesnt give errors, just doesnt work.

pawn Код:
CMD:name(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You must be level 3+ to use this command.");
    if(sscanf(params, "u", playerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /name [on]/[off]");
    if(!strcmp(params, "on", true))
    {
        SendClientMessage(playerid,COLOR_LIME,"[NAME] Your name has been successfully hidden !");
        GameTextForPlayer(playerid,"~r~showname off",3000,1);
        for(new i = 0; i != MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 0);
        }
    }
    else if(!strcmp(params, "off", true))
    {
        SendClientMessage(playerid,COLOR_LIME,"[NAME] Your name has been successfully unhidden !");
        GameTextForPlayer(playerid,"~g~showname on",3000,1);
        for(new i = 0; i != MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 1);
        }
    }
    return 1;
}
Reply


Messages In This Thread
What's wrong with this name on/off cmd - by Fiore - 29.12.2012, 22:43
Re: What's wrong with this name on/off cmd - by aslan890 - 29.12.2012, 22:50
Re: What's wrong with this name on/off cmd - by Fiore - 29.12.2012, 23:07
Re: What's wrong with this name on/off cmd - by aslan890 - 29.12.2012, 23:08
Re: What's wrong with this name on/off cmd - by Threshold - 29.12.2012, 23:27

Forum Jump:


Users browsing this thread: 3 Guest(s)