Employment and command errors.
#1

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 211possibly unintended assignment
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(433) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(437) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(438) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(444) : error 010invalid function or declaration 
LINES:

PHP код:
CMD:employmower(playeridparams[])
[
WARNING 429]if(lawnmower[playerid] = 1)
{
SendClientMessage(playeridCOLOR_RED,"[ERROR]{FFFFFF}You're already employed as lawn-mower!");
}
[
ERROR LINE 433]if(employment[playerid] = 1)
{
SendClientMessage(playeridCOLOR_RED"You already have a job!");
}
[
ERROR LINE 437]if(!IsPlayerInRangeOfPoint(playerid,3,1895.7168,1729.1393,10.8153)) return SendClientMessage(playeridCOLOR_RED"[ERROR]{FFFFFF}You're not near mowers' hut");
[
ERROR LINE 438]if(IsPlayerInRangeOfPoint(playerid3,1895.7168,1729.1393,10.8153))
{
SendClientMessage(playeridCOLOR_LIGHTGREEN"[SUCCESS!]{FFFFFF}You've employed yourself as a lawnmower!");
employment[playerid] = 1;
lawnmower[playerid] = 1;
}
[
ERROR LINE 444]return 1;

Reply
#2

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;
}
Reply
#3

Thank you very very much.
Reply


Forum Jump:


Users browsing this thread: