Script Error
#1

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..
Reply
#2

( and { isn't same xD

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

Reply
#3

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.
Reply
#4

Thx all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)