Employment and command 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)
+--- Thread: Employment and command errors. (
/showthread.php?tid=521868)
Employment and command errors. -
Bek_Loking - 24.06.2014
Hey. I made a script so someone employs themselves as a lawnmower. Well, it gave me these errors.
PHP код:
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(429) : warning 211: possibly unintended assignment
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(433) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(437) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(438) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(444) : error 010: invalid function or declaration
LINES:
PHP код:
CMD:employmower(playerid, params[])
[WARNING 429]if(lawnmower[playerid] = 1)
{
SendClientMessage(playerid, COLOR_RED,"[ERROR]{FFFFFF}You're already employed as lawn-mower!");
}
[ERROR LINE 433]if(employment[playerid] = 1)
{
SendClientMessage(playerid, COLOR_RED, "You already have a job!");
}
[ERROR LINE 437]if(!IsPlayerInRangeOfPoint(playerid,3,1895.7168,1729.1393,10.8153)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not near mowers' hut");
[ERROR LINE 438]if(IsPlayerInRangeOfPoint(playerid, 3,1895.7168,1729.1393,10.8153))
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've employed yourself as a lawnmower!");
employment[playerid] = 1;
lawnmower[playerid] = 1;
}
[ERROR LINE 444]return 1;
}
Re: Employment and command errors. -
Jefff - 24.06.2014
open bracket missing after params[]) and for comparing integers you need == not =
pawn Код:
CMD:employmower(playerid, params[])
{
if(lawnmower[playerid] == 1) SendClientMessage(playerid, COLOR_RED,"[ERROR]{FFFFFF}You're already employed as lawn-mower!");
else if(employment[playerid] == 1) SendClientMessage(playerid, COLOR_RED, "You already have a job!");
else if(!IsPlayerInRangeOfPoint(playerid,3,1895.7168,1729.1393,10.8153)) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not near mowers' hut");
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've employed yourself as a lawnmower!");
employment[playerid] = 1;
lawnmower[playerid] = 1;
}
return 1;
}
Re: Employment and command errors. -
Bek_Loking - 24.06.2014
Thank you very very much.