Scripting 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: Scripting errors (
/showthread.php?tid=146946)
Scripting errors -
TheNuttyScientist - 09.05.2010
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(183) : error 017: undefined symbol "strtok"
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(183) : error 033: array must be indexed (variable "cmd")
The line:
Код:
cmd = strtok(cmdtext, idx);
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 036: empty statement
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 001: expected token: ";", but found ")"
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : fatal error 107: too many error messages on one line
The line.
Код:
if(strcmp;cmd, "/surrender", true) == 0) {
Re: Scripting errors -
Las Venturas CNR - 09.05.2010
Before
cmd = strtok(cmdtext, idx);
do you have
new cmd[256];
?
Re: Scripting errors -
TheNuttyScientist - 09.05.2010
Quote:
Originally Posted by LV CNR
Before
cmd = strtok(cmdtext, idx);
do you have
new cmd[256];
|
I have it on line 180.
Re: Scripting errors -
Las Venturas CNR - 09.05.2010
Try:
Код:
if(strcmp(cmd, "/surrender", true) == 0) {
Instead. I think you messed up your code there...

Tell me if it works.
Re: Scripting errors -
TheNuttyScientist - 09.05.2010
It has made more errors, funnily enough.
Re: Scripting errors -
aircombat - 09.05.2010
add this bottom of ur script :
Код:
stock 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;
}
Re: Scripting errors -
TheNuttyScientist - 09.05.2010
That has also not worked.
Re: Scripting errors -
aircombat - 09.05.2010
and edit :
if(strcmp;cmd, "/surrender", true) == 0) {
to
if(strcmp(cmd, "/help", true) == 0) {
Re: Scripting errors -
NiiRV4N4 - 09.05.2010
:O
Re: Scripting errors -
TheNuttyScientist - 10.05.2010
Quote:
Originally Posted by NiiRV4N4
:O
|
That's all?