SA-MP Forums Archive
[help]What are these errors? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [help]What are these errors? (/showthread.php?tid=103045)



[help]What are these errors? - Tigerbeast11 - 18.10.2009

Here is the code, taken from LAdmin, edited by me:

pawn Код:
dcmd_slap(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 2) {
          new tmp[256], tmp2[256], Index;       tmp = strtok(params,Index), tmp2 = strtok(params,Index);
          if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
            player1 = strval(tmp);              new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            GetPlayerName(player1, playername, sizeof(playername));
            GetPlayerName(playerid, adminname, sizeof(adminname));
            new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health);
            GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+26); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);

            if(strlen(tmp2)) {
                format(string,sizeof(string),"%s (id:%d) has slapped %s (id:%d) for: %s",adminname,playerid,playername,player1,params[2]); return SendClientMessageToAll(orange,string); }
                } else {
                format(string,sizeof(string),"%s (id:%d) has slapped %s (%d) for [No Reason Defined]",adminname,playerid,playername,player1); return SendClientMessageToAll(orange,string); }
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Errors:
Код:
(2597) : error 017: undefined symbol "player1"
(2606) : error 017: undefined symbol "string"
(2606) : error 017: undefined symbol "string"
(2606) : error 029: invalid expression, assumed zero
(2606) : fatal error 107: too many error messages on one line
Greetz



Re: [help]What are these errors? - dice7 - 18.10.2009

stop posting this topic everywhere


Re: [help]What are these errors? - Tigerbeast11 - 18.10.2009

It is actually in 0.3 scripting, but, since LAdmin is from 0.2, I thought I'd post here aswell.

Any helpful suggestions?