SA-MP Forums Archive
Script Error - 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: Script Error (/showthread.php?tid=294215)



Script Error - Champ - 31.10.2011

when i typed this
if (strcmp("/kill", cmdtext, true, 5) == 0)
(
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, " You Have Commited Suicide ");
return 1;
)
in public OnPlayerCommandText(playerid, cmdtext[]) and compile it then the error shows
these are the errors
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(113 -- 114) : error 001: expected token: ")", but found ";"
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(115) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(115) : warning 217: loose indentation
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(116) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(116) : warning 217: loose indentation
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(116) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(116 -- 117) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\testing.pwn(117) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

and when i replace this
if (strcmp("/kill", cmdtext, true, 5) == 0)
(
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, " You Have Commited Suicide ");
return 1;
)
to this

if (strcmp("/help", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "(INFO) Welcome in my Server's HELP command!");
SendClientMessage(playerid, COLOR_YELLOW, "(INFO) Hope you enjoy the tutorial!");
return 1;
}

then no error

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

is there any solution
i want to add /kill cmd in my server..



Re: Script Error - [MG]Dimi - 31.10.2011

( and { isn't same xD

PHP код:
if (strcmp("/kill"cmdtexttrue5) == 0)
{
SetPlayerHealth(playerid0);
SendClientMessage(playeridCOLOR_YELLOW" You Have Commited Suicide ");
return 
1;




Re: Script Error - Stigg - 31.10.2011

Try:
pawn Код:
if (strcmp("/kill", cmdtext, true, 5) == 0)
{
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, COLOR_YELLOW, " You Have Commited Suicide ");
    return 1;
}
Edit: Too slow.


Re: Script Error - Champ - 31.10.2011

Thx all