/rp command problem (sscanf) (rp = report ciminality
#1

Hello

i have a problem with /rp command i am using sscanf

Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : warning 217: loose indentation
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : error 017: undefined symbol "reason"
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : warning 215: expression has no effect
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : error 001: expected token: ";", but found "]"
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : error 029: invalid expression, assumed zero
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2082) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
these are my errors


Код:
[	dcmd_rp(playerid, params[])
	{
	new
		id;
		reason[64];
	if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/ban <playerid/partname> <reason (optional)>\"");
	else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else if (GetDistanceBetweenPlayers(playerid,id) > 5) SendClientMessage(playerid,donkerrood,"The player is too far away");
	else if (gTeam[playerid] != TEAM_COPS) { SendClientMessage(playerid,donkerrood,"You aren't a Cop"); }
	else if (gTeam[id] == TEAM_COPS) { SendClientMessage(playerid,donkerrood,"You cant report criminality over a cop"); }
	else if (GetPlayerWantedLevel(id) > 0) { SendClientMessage(playerid,donkerrood,"Player is already wanted"); }
	else if (gTeam[playerid] == TEAM_COPS)
	{
		format(reason, sizeof (reason), "You have been banned%s%s.", reason[0] ? (" because: ") : (""), reason);
		SendClientMessage(id, donkerrood, reason);
		SendClientMessage(playerid, 0x00FF00AA, "Player reported");
		SetPlayerWantedLevel(id,2);
	}
	return 1;
}/code]

thar's my cmd


Код:
	if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/ban <playerid/partname> <reason (optional)>\"");
thats's line of errors

help plz!!!1
Reply
#2

pawn Код:
new id;
    reason[64];
Should be:
pawn Код:
new id,
    reason[64];
Reply
#3

new
id;
reason[64];

to
new
id,
reason[64];


Edit:I'm late lol
Reply
#4

ok

only have one prublem

it only says

you have been banned

but without the reason and everything:S

how could i think this
Reply
#5

Try
Код:
sscanf(params,"us",.....
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)