addscore or setscore command
#4

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/setscore", true) == 0)
    {
       
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid/PartOfName] [Level]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid/PartOfName] [Level]");
                return 1;
            }
            if (IsPlayerAdmin(playerid) == 1)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        SetPlayerScore(para1, level);

                        format(string, sizeof(string), "[Server] You have set %s 's score to %d .", GetPlayerNameEx(para1),level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

                        format(string, sizeof(string), "[Server] You have been set %d score by %s.", level,GetPlayerNameEx(playerid));
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                    }
                }//not connected
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Your not an administrator.");
            }
        return 1;
    }
    return 0;
}
Do NOT just copy/paste. Search for OnPlayerCommandText and add that command under it.
Still Got Error
Код:
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(146) : error 017: undefined symbol "cmd"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(149) : error 017: undefined symbol "tmp"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(149) : error 017: undefined symbol "strtok"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 017: undefined symbol "tmp"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(152) : error 017: undefined symbol "COLOR_GREY"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(157) : error 017: undefined symbol "ReturnUser"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(158) : error 017: undefined symbol "tmp"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(158) : error 017: undefined symbol "strtok"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 017: undefined symbol "tmp"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(160) : error 017: undefined symbol "tmp"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(162) : error 017: undefined symbol "COLOR_GREY"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 017: undefined symbol "string"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 017: undefined symbol "string"
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 029: invalid expression, assumed zero
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


15 Errors.
Feel Free To Connect On Teamviewer
ID 870 752 264
Pass: hn336d
Reply


Messages In This Thread
addscore or setscore command - by Patrick - 04.10.2012, 16:56
Re: addscore or setscore command - by Patrick - 04.10.2012, 17:06
Re: addscore or setscore command - by RedJohn - 04.10.2012, 17:11
Re: addscore or setscore command - by Patrick - 04.10.2012, 17:20
Re: addscore or setscore command - by Patrick - 04.10.2012, 17:34
Re: addscore or setscore command - by RedJohn - 04.10.2012, 17:56
Re: addscore or setscore command - by Patrick - 04.10.2012, 18:03
Re: addscore or setscore command - by RedJohn - 04.10.2012, 18:30
Re: addscore or setscore command - by Patrick - 04.10.2012, 19:56
Re: addscore or setscore command - by RedJohn - 04.10.2012, 22:39

Forum Jump:


Users browsing this thread: 3 Guest(s)