[Help]/setskin help
#1

pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setskin [playerid/PartOfName] [skin id]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 5)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));

                        PlayerInfo[para1][pChar] = level;
                        format(string, sizeof(string), "** Administrator %s Has Changed Your Skin.", sendername);
                        SendClientMessage(para1, TEAM_GROVE_COLOR, string);
                        format(string, sizeof(string), "** You Granted %s skin number %d.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_ORANGE, string);
                        format(string, sizeof(string), "[ADMIN]: %s Gave The Skin [%d] to %s (%d).",sendername, level, giveplayer, para1);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                        SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave The Skin [%d] to %s",d,m,y,h,mi,s,sendername,level,giveplayer);
                        GiveLog(string);
                    }
                }//not connected
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
Код:
C:\Users\AztecasGamerzzz\Desktop\GOod Servers\TR-RP\gamemodes\TR-RP.pwn(36601) : error 017: undefined symbol "pChar"
C:\Users\AztecasGamerzzz\Desktop\GOod Servers\TR-RP\gamemodes\TR-RP.pwn(36608) : error 017: undefined symbol "pChar"
ERRORS
Reply
#2

Код:
if(strcmp(cmd, "/setskin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setskin [playerid/PartOfName] [skin id]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 5)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));

                        PlayerInfo[para1][pChar] = level;
                        format(string, sizeof(string), "** Administrator %s Has Changed Your Skin.", sendername);
                        SendClientMessage(para1, TEAM_GROVE_COLOR, string);
                        format(string, sizeof(string), "** You Granted %s skin number %d.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_ORANGE, string);
                        format(string, sizeof(string), "[ADMIN]: %s Gave The Skin [%d] to %s (%d).",sendername, level, giveplayer, para1);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                        SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave The Skin [%d] to %s",d,m,y,h,mi,s,sendername,level,giveplayer);
                        GiveLog(string);
                    }
                }
               return 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
-Not all sure if it works, it should be working.
Reply
#3

Add pChar variable in your player's info enum.
Reply
#4

i added
pawn Код:
new pChar
its works..but one error
Код:
C:\Users\AztecasGamerzzz\Desktop\GOod Servers\TR-RP\gamemodes\TR-RP.pwn(36580) : error 036: empty statement
pawn Код:
if(IsPlayerConnected(playerid));
This is the line..
Its not GF edit..its a Ravens rp but im not editing it.
Reply
#5

Where is info enum..
btw how can i add new skin in my RP GM.
Reply
#6

Show us the line BEFORE that error.
Reply
#7

pawn Код:
new pChar
Reply
#8

pawn Код:
if(IsPlayerConnected(playerid));
Remove the ";".

pawn Код:
if(IsPlayerConnected(playerid))
Reply
#9

It should be something like that
pawn Код:
enum pInfo
{
    pAdmin,
    // More
    pChar // <- At the last no ","
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)