Converting a sscanf command to Zcmd
#1

pawn Code:
CMD:setskin(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
        new string[128], giveplayerid, skinid;
        if(sscanf(params, "ud", giveplayerid, skinid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if(!IsInvalidSkin(skinid))
            {
                if(GetPlayerSkin(giveplayerid) == skinid)
                {
                    SendClientMessageEx( playerid, COLOR_WHITE, "The player you're trying to change skins of already is using the skin you're trying to set." );
                }
                else
                {
                    PlayerInfo[giveplayerid][pChar] = skinid;
                    PlayerInfo[giveplayerid][pModel] = skinid;
                    format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
                    format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
                    SendClientMessageEx(playerid, COLOR_WHITE, string);
                    SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
                }
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Please Convert it to ZCMD and thanks
Reply
#2

This IS ZCMD already ...

This forum requires that you wait 120 seconds between posts. Please try again in 47 seconds.
Reply
#3

SSCANF IS USING ZCMD (BOTH TOGETHER) so if you have ZCMD you have SSCANF and vice versa
Reply
#4

The problem that it is not working For me, ZCMD CMDs like, /getplayer /getcar /gotoplayer... are working but others (i think the problem is with sscanf) are not working even on the log i don't see the command exp : when i /getcar it works and I see it on the log, when i /setskin it doesn't work and doesn't appear on the log and as you see the script is fine, that happened after updating it to 0.3e
Reply
#5

Listen to the others above you serra.
Reply
#6

Do you have the latest 0.3e include files (.INC Files) ?
Reply
#7

if ur using ZCMD the others wont work..
Reply
#8

Oh really? so what should I do?
Reply
#9

Quote:
Originally Posted by Red_Dragon.
View Post
Do you have the latest 0.3e include files (.INC Files) ?
Yes I have
Reply
#10

Convert all the others to zcmd?

or convert the zcmd commands to the thing the other cmds are using.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)