[Help] /SetRank Command (like admins)
#7

Command:

Код:
if(strcmp("/S25SetRank", cmdtext, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(S25TRank[playerid] >= 4)
            {
                new idx;
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /S25SetRank [playerid/PartOfName] [level]");
                    return 1;
                }
                new para1;
                new level;
                new tmp[256];
                new giveplayer[MAX_PLAYER_NAME];
                para1 = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                level = strval(tmp);
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][S25TRank] = level;
                        printf("	Filterscript: S25: %s promoted %s to level %d S25 worker.", sendername, giveplayer, level);
                        format(string, sizeof(string), "Server: You have been promoted to a level %d Stage 25 Worker by %s.", level, sendername);
                        SendClientMessage(para1, COLOR_SERVER, string);
                        format(string, sizeof(string), "Server: You have promoted %s to a level %d Stage 25 Worker.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_SERVER, string);
                    }
                }
            }
        }
        return 1;
    }


Error:

Код:
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1144) : error 017: undefined symbol "tmp"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1144) : error 017: undefined symbol "strtok"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1145) : error 017: undefined symbol "tmp"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1147) : error 017: undefined symbol "COLOR_GRAD2"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1154) : error 017: undefined symbol "ReturnUser"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1155) : error 017: undefined symbol "strtok"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1155) : error 033: array must be indexed (variable "tmp")
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1162) : error 017: undefined symbol "sendername"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1162) : error 017: undefined symbol "sendername"
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1162) : error 029: invalid expression, assumed zero
C:\Servers\SAMP\Testing Server\Programming\filterscripts\Stage_25_Towing_V0.pwn(1162) : fatal error 107: too many error messages on one line
I can fix the color error real quick.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)