Strange Error
#1

Guyz Can Anyone Help me with this problem? i felt this problem strange

Код:
C:\Users\GMZeus\Desktop\Cops Robbers Project Back Up\strcmp_command.pwn(150) : error 017: undefined symbol "string"
C:\Users\GMZeus\Desktop\Cops Robbers Project Back Up\strcmp_command.pwn(150) : error 017: undefined symbol "string"
C:\Users\GMZeus\Desktop\Cops Robbers Project Back Up\strcmp_command.pwn(151) : error 017: undefined symbol "otherplayer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
This Is The Command I Tryed To Insert

Код:
if(strcmp(cmdtext, "/setscore", true) == 0)
    {
        new sendername[MAX_PLAYER_NAME];
        new tmp[256];
        new tmp2[256];
        new givenplayer = strval(tmp);
        new score = strval(tmp2);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setscore [playerid] [Score]");
        SetPlayerScore(givenplayer,score);
        GetPlayerName(playerid,sendername, sizeof(sendername));
        format(string,sizeof string,"Admin %s Has set your score to %d ",sendername,score);
        SendClientMessage(otherplayer, COLOR_GREEN, string);
        return 1;
    }
Can Someone Help Me Pls!
Reply
#2

Did you make a public function or stock for it ? http://wiki.sa-mp.com/wiki/Public_functions
Reply
#3

This should work:


Код:
if(strcmp(cmdtext, "/setscore", true) == 0)
    {
        new string[128], otherplayer[MAX_PLAYER_NAME]; 
        new sendername[MAX_PLAYER_NAME];
        new tmp[256];
        new tmp2[256];
        new givenplayer = strval(tmp);
        new score = strval(tmp2);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setscore [playerid] [Score]");
        SetPlayerScore(givenplayer,score);
        GetPlayerName(playerid,sendername, sizeof(sendername));
        format(string,sizeof string,"Admin %s Has set your score to %d ",sendername,score);
        SendClientMessage(otherplayer, COLOR_GREEN, string);
        return 1;
    }
Reply
#4

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
This should work:


Код:
if(strcmp(cmdtext, "/setscore", true) == 0)
    {
        new string[128], otherplayer[MAX_PLAYER_NAME]; 
        new sendername[MAX_PLAYER_NAME];
        new tmp[256];
        new tmp2[256];
        new givenplayer = strval(tmp);
        new score = strval(tmp2);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setscore [playerid] [Score]");
        SetPlayerScore(givenplayer,score);
        GetPlayerName(playerid,sendername, sizeof(sendername));
        format(string,sizeof string,"Admin %s Has set your score to %d ",sendername,score);
        SendClientMessage(otherplayer, COLOR_GREEN, string);
        return 1;
    }
Thnx Bro!!! +Rep For You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)