SA-MP Forums Archive
anyone know this error? - 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: anyone know this error? (/showthread.php?tid=296378)



anyone know this error? - Mr_Scripter - 11.11.2011

as the title says.. anyone know What this error Means?
pawn Код:
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(750) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
it comes with
pawn Код:
COMMAND:Ranks(playerid, params[])
{
    #pragma unused params
    if(GetPlayerScore(playerid = 0)) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Newbie");
    return 1;
}



Re: anyone know this error? - Stigg - 11.11.2011

Try:
pawn Код:
COMMAND:Ranks(playerid, params[])
{
    #pragma unused params
    if(GetPlayerScore(playerid) == 0) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Newbie");
    return 1;
}
You missed '=' easily done.


Re: anyone know this error? - Mr_Scripter - 11.11.2011

oh thanks i had forgot "="


Re: anyone know this error? - SmiT - 11.11.2011

You're using the "equal" operator wrong, correct usage would be == see - https://sampwiki.blast.hk/wiki/Control_Structures#Operators


Re: anyone know this error? - Sasino97 - 11.11.2011

Use '==' instead of '='

'=' Assigns
'==' Checks


Re: anyone know this error? - Mr_Scripter - 11.11.2011

Quote:
Originally Posted by SmiT
Посмотреть сообщение
You're using the getplayerfunction wrong, and the "equal" operator would be == see - https://sampwiki.blast.hk/wiki/Control_Structures#Operators

pawn Код:
if ( GetPlayerScore ( playerid ) == 5 )
i've had Done it like this first but in this one also i had forgot "=" which gived much errors so i thought this is wrong Method i tried the other and it gived one error
Thanks to both


Re: anyone know this error? - Mr_Scripter - 11.11.2011

sorry for double posting but What does these Errors Means? all are same
pawn Код:
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(751) : warning 209: function "cmd_Ranks" should return a value
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(752) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(754) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(756) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(758) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(760) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(762) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(764) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(766) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(768) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(770) : error 010: invalid function or declaration
E:\GTA - San Andreas\Pawno Scripting\gamemodes\Script.pwn(772) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


11 Errors.



Re: anyone know this error? - Kostas' - 11.11.2011

For the warning you missed a return 1;


Re: anyone know this error? - Mr_Scripter - 11.11.2011

Mhm... Anything wrong?
pawn Код:
COMMAND:Ranks(playerid, params[])
{
    #pragma unused params
    if(GetPlayerScore(playerid) == 0) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Newbie");
    }
    else if
    {
    if(GetPlayerScore(playerid) == 100) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Killa");
    }
    else if
    {
    if(GetPlayerScore(playerid) == 200) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Young Gangsta");
    }
    else if
    {
    if(GetPlayerScore(playerid) == 300) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Mobsta");
    }
    else if
    {
    if(GetPlayerScore(playerid) == 500) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Gangsta");
    }
    else if
    {
    if(GetPlayerScore(playerid) == 900) return SendClientMessage(playerid, COLOR_PINK, "Your Rank is Boss");
    }
    return 1;
}



Re: anyone know this error? - Kostas' - 11.11.2011

Use else not else if