SA-MP Forums Archive
Compiling 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)
+--- Thread: Compiling errors (/showthread.php?tid=661191)



Compiling errors - Kosso - 25.11.2018

Quote:

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(132 6) : error 001: expected token: "{", but found "new"

Код:
1326: new Damage[MAX_PLAYERS][MAX_WEAPONS][W_DAMAGE][MAX_BODY_PARTS];
Quote:

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 67) : error 017: undefined symbol "SendErrorMessage"

Код:
65967:         return SendErrorMessage(playerid, "* Un admininistrator a dat deja un raspuns la acest repoart sau jucatorul respectiv nu a dat report !");


Quote:

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 72) : warning 219: local variable "GetPlayerNameEx" shadows a variable at a preceding level

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 74) : error 001: expected token: "}", but found ")"

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 74) : error 029: invalid expression, assumed zero

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 74) : warning 215: expression has no effect

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 7 : error 012: invalid function call, not a valid address

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 7 : warning 215: expression has no effect

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 7 : error 001: expected token: ";", but found ")"

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 7 : error 029: invalid expression, assumed zero

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 7 : fatal error 107: too many error messages on one line


Код:
  
this is from 65970 to 65982
  {
        new pos = 30;
        new GetPlayerNameEx[MAX_PLAYER_NAME];
        if(pos < 30-1) pos = 30;
        format(szMessage, 128,"[REPORT] Administratorul %s ti-a raspuns la report. Motiv: %.*s ...", GetPlayerNameEx{playerid), pos, szReason);
        SendClientMessage(iPlayerID, COLOR_YELLOW, szMessage);
        format(szMessage, 128,"... %s", szReason[pos]);
        SendClientMessage(iPlayerID, COLOR_YELLOW, szMessage);
        format(szMessage, 128,"[AdmCmd] %s (%d) i-a raspuns la report lui %s (%d). Motiv: %.*s ...", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(iPlayerID), iPlayerID, pos, szReason);
        AdministratorMessage(COLOR_ORANGE,szMessage,1);
        format(szMessage, 128,"... %s", szReason[pos]);
        AdministratorMessage(COLOR_ORANGE,szMessage,1);
	}
What should i do?


Re: Compiling errors - DAKYSKYE - 25.11.2018

1.
show us the lines before
2.
there is no function named SendErrorMessage, so if u have copied something from another gamemode script, let's searcj that function and copy it too
3.1
GetPlayerNameEx is must be a function, so you have to just remove that line.
3.2
You have to write ( instead of {, I mean -
PHP код:
format(szMessage128,"[REPORT] Administratorul %s ti-a raspuns la report. Motiv: %.*s ..."GetPlayerNameEx(playerid), posszReason); 
3.3
Tell me which line is error-charged, I'll help u then.


Re: Compiling errors - Kosso - 25.11.2018

1
Quote:

enum W_DAMAGE

new Damage[MAX_PLAYERS][MAX_WEAPONS][W_DAMAGE][MAX_BODY_PARTS];
2. this is what i have at SendErrorMessage
Quote:

#define ERRORMESSAGE_COLOR COLOR_GREY

stock SendErrorMessage(playerid, const string[])
{
if(strlen(string) < 2)
{
return 1;
}

SendClientMessage(playerid,ERRORMESSAGE_COLOR,stri ng);

return 1;
}

and this is the line with the error
Quote:

65967: return SendErrorMessage(playerid, "* Un admininistrator a dat deja un raspuns la acest repoart sau jucatorul respectiv nu a dat report !");


EDIT :

If i replace the { with ( i get those errors:

Quote:

(1326) : error 001: expected token: "{", but found "new"
(170 : warning 201: redefinition of constant/macro (symbol "MAX_BODY_PARTS")
(1709) : warning 201: redefinition of constant/macro (symbol "MAX_WEAPONS")
(65967) : error 017: undefined symbol "SendErrorMessage"
(65972) : warning 219: local variable "GetPlayerNameEx" shadows a variable at a preceding level
(65974) : error 012: invalid function call, not a valid address
(65974) : warning 215: expression has no effect
(65974) : error 001: expected token: ";", but found ")"
(65974) : error 029: invalid expression, assumed zero
(65974) : fatal error 107: too many error messages on one line

this is the line 65974
Код:
 format(szMessage, 128,"[REPORT] Administratorul %s ti-a raspuns la report. Motiv: %.*s ...", GetPlayerNameEx(playerid), pos, szReason);



Re: Compiling errors - Kosso - 25.11.2018

I managed to get rid of some error but i keep getting those:
Quote:

C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 71) : warning 219: local variable "GetPlayerNameEx1" shadows a variable at a preceding level
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 71) : error 001: expected token: ";", but found "("
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 71) : warning 215: expression has no effect
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 73) : error 012: invalid function call, not a valid address
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 73) : warning 215: expression has no effect
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 73) : error 001: expected token: ";", but found ")"
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 73) : error 029: invalid expression, assumed zero
C:\Users\BOGDAN\Desktop\GM\gamemodes\frank.pwn(659 73) : fatal error 107: too many error messages on one line

those are the lines
Quote:

(65971): new GetPlayerNameEx1(playerid);
(65973): format(szMessage, 128,"[REPORT] Administratorul %s ti-a raspuns la report. Motiv: %.*s ...", GetPlayerNameEx1(playerid), pos, szReason);