SA-MP Forums Archive
When it comes to this line, it's comming up with Command Not known. - 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: When it comes to this line, it's comming up with Command Not known. (/showthread.php?tid=479543)



When it comes to this line, it's comming up with Command Not known. - Brandon_More - 05.12.2013

Ok, So I created a ratio inside /stats when someone is inside PB. And Well when It comes to this line it sends the client error message saying Command not found.

Line:
Код:
	if(PlayerTemp[playerid][onpaint] > 0) SendClientMSG(forplayerid, COLOR_WHITE,"{FF4500}>{FFFFFF} Paintball kills:[%d] - Paintball deaths:[%d] - Ratio:[%0.2f]",PlayerInfo[playerid][pbkills],PlayerInfo[playerid][pbdeaths],(PlayerInfo[playerid][pbkills]/PlayerInfo[playerid][pbdeaths]));



Re: When it comes to this line, it's comming up with Command Not known. - Konstantinos - 05.12.2013

pawn Код:
(PlayerInfo[playerid][pbkills]/PlayerInfo[playerid][pbdeaths])
Make sure that pbdeaths is not 0 because a runtime error about diving with 0 will be caused.

pawn Код:
(PlayerInfo[playerid][pbdeaths] != 0) ? floatdiv(PlayerInfo[playerid][pbkills], PlayerInfo[playerid][pbdeaths]) : 0.0