What this warning?
#1

Код:
C:\Documents and Settings\Mako\Desktop\Untitled.pwn(40) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
on this line

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buylevel", cmdtext, true, 9) == 0)
    {
        if(GetPVarInt(playerid, "p_Respect") >= 10)
        {
            SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
            SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You have buy 1 level.");
        }
        else
        {
            return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Dont have respects.");
        }
        return 1;
    }
} //LINE 40
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buylevel", cmdtext, true, 9) == 0)
    {
        if(GetPVarInt(playerid, "p_Respect") >= 10)
        {
            SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
            SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You have buy 1 level.");
        }
        else
        {
            return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Dont have respects.");
        }
        return 1;
    }
    return 0;
}
Reply
#3

Should fix.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buylevel", cmdtext, true, 9) == 0)
    {
        if(GetPVarInt(playerid, "p_Respect") >= 10)
        {
            SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
            SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You have buy 1 level.");
        }
        else
        {
            return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Dont have respects.");
        }
        return 1;
    }
    return 0;
}
Reply
#4

thanks very much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)