GameMode compile problem. -
RaulSTARs - 14.02.2012
Hello everybody.
I have those errors.
Код:
pawno\include\streamer.inc(395) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")
sZn.pwn(14299) : error 021: symbol already defined: "strtok"
Код:
strtok(const string[], &index)
{
sZn.pwn(14314) : error 047: array sizes do not match, or destination array is too small
sZn.pwn(19023) : warning 219: local variable "mod" shadows a variable at a preceding level
How can I fix those errors?
Please help me.
Regards.
Re: GameMode compile problem. -
[MG]Dimi - 14.02.2012
1) I can't undertsand what you wanna say.
2) Delete that stock strtok because you already have it somewhere.
3) Show us line 14313 (one before 'return result;')
4) you have new mod twice in your script, probably as global variables
Re: GameMode compile problem. -
Konstantinos - 14.02.2012
1st error: The OnPlayerEnterRaceCheckpoint Callback is defined on Incognito's Streamer and on your GameMode.
Ignore it for now!
2nd error:remove the strtok from line 14299
Note: All these
pawn Код:
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 result;
}
3rd error: I think that the array sizes don't match. Can you show us the part of code that you return the result.
4th error: You already use the local variable. An example
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new mod; // 1st mod
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
new mod; // 2nd time we are using it.
return 1;
}
return 0;
}
Edit: Dimi was faster
Re: GameMode compile problem. -
RaulSTARs - 14.02.2012
1)I want to fix the errors.
2)Dont work , if i remove it , and compile I will wait 5-10 seconds and after is appearing the clipping vertical bar from text and don't do anything.
3)
Код:
}
result[index - offset] = EOS;
return result;
}
I will try now the 2nd post , and I will edit.
---------------------------------------------------------------------
i posted the return result up
I fixed the 2 ERRORs and now i have that RaceCheckPOint warning and
sZn.pwn(19006) : warning 219: local variable "mod" shadows a variable at a preceding level
I dont find another new mod or something.
--------------------
Omg i try to open the server with 2 warning and
[18:40:59] Script[gamemodes/sZn.amx]: Run time error 19: "File or function is not found"
[18:40:59] Number of vehicle models: 0
Re: GameMode compile problem. -
Konstantinos - 14.02.2012
Please read the rules and don't double post, there is a Edit Button
That happened because you tried to run the Gamemode while it hasn't been compiled.
The warnings don't cause it, but only errors. Post the error after compiling here please to try ti fix it!
Re: GameMode compile problem. -
RaulSTARs - 14.02.2012
It's Compiled. I have the amx but dont work