12.11.2012, 12:27
I have this error:
On this line under:
How to fix it? +rep to the one who helps me!
And also ive got this Warnings:
On lines:
The Errors and Warnings:
The Whole Code:
Код:
error 029: invalid expression, assumed zero
Код:
strtok(const string[], &index)
And also ive got this Warnings:
Код:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43771) : warning 219: local variable "idx" shadows a variable at a preceding level C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43772) : warning 219: local variable "cmd" shadows a variable at a preceding level C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43786) : warning 219: local variable "string" shadows a variable at a preceding level
Код:
Line 43771: new idx; Line 43772: new cmd[128]; Line 43786: new string[100];
Код:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43771) : warning 219: local variable "idx" shadows a variable at a preceding level C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43772) : warning 219: local variable "cmd" shadows a variable at a preceding level C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43786) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43803) : error 029: invalid expression, assumed zero C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43803) : error 029: invalid expression, assumed zero C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43803) : error 029: invalid expression, assumed zero C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43803) : fatal error 107: too many error messages on one line
Код:
if(strcmp(cmd, "/getevidence", true) == 0) { new idx; new cmd[128]; cmd = strtok(cmdtext, idx); { if(IsACop(playerid)) //Your own variable u must change it { SendClientMessage(playerid, COLOR_RED, " You are not a Cop / FBI / Prison Guard !"); return 1; } foreach (Player, i) { if(IsPlayerInRangeOfPoint(playerid, 3, Xa[i], Ya[i], Za[i])) { new name[128]; new string[100]; //Not sure about this size GetPlayerName(killer1[i], name, sizeof(name)); format(string, sizeof(string),"The body was murdered by %s , Cause: %s.",name,Reason[i]); SendClientMessage(playerid, COLOR_RED, string); } else { SendClientMessage(playerid, COLOR_RED, " You are not near any deadbody"); return 1; } } } return 0; } #define index strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return 1; }