anyone know this error?
#1

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

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.
Reply
#3

oh thanks i had forgot "="
Reply
#4

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

Use '==' instead of '='

'=' Assigns
'==' Checks
Reply
#6

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
Reply
#7

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.
Reply
#8

For the warning you missed a return 1;
Reply
#9

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

Use else not else if
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)