Warning 209.
#1

Hello, I got this error when i compile my gamemode,
Код:
D:\ServerFiles\SA-MP\gamemodes\FLZRP.pwn(863) : warning 209: function "ProxDetector" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Here's my code
pawn Код:
CMD:whisper(playerid, params[])
{
    new sender[MAX_PLAYER_NAME], target[MAX_PLAYER_NAME], string[128], strings[128], id;
    if(!ProxDetector(8.0, playerid, target, -1)) return SendClientMessage(playerid, -1, ""#COL_COOLBLUE"SERVER: The player is too far from you");
    if(sscanf(params, "us", id, strings)) return SendClientMessage(playerid, -1, ""#COL_COOLBLUE"SERVER"#COL_WHITE": /(w)hisper [Player ID / Part of Name] [Message]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""#COL_COOLBLUE"SERVER: "#COL_RED"Invalid player ID / Player not Connected!");
    if(playerid == id) return SendClientMessage(playerid, -1, ""#COL_COOLBLUE"SERVER: "#COL_RED"You cannot Whisper yourself!");
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(id, target, sizeof(target));
    format(string, sizeof(string), ""#COL_COOLGREEN"Whisper to "#COL_COOLORANGE"%s(ID: %d): "#COL_COOLBLUE"%s", target, id, strings);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), ""#COL_COOLGREEN"Whisper from "#COL_COOLORANGE"%s(ID: %d): "#COL_COOLBLUE"%s", sender, playerid, strings);
    SendClientMessage(id, -1, string);
    return 1;
}
Yeah so, Maybe that is a dumb question, Because i was a newbie scripter, But I'm learning..
Reply
#2

just add 'return' to ProxDetector func
Reply
#3

Quote:
Originally Posted by detter
Посмотреть сообщение
just add 'return' to ProxDetector func
give me the code?
Reply
#4

sorry i don't have that func. but it's very simple...
add 'return 1;' just before last '}'

Код:
stock ProxDetector(bla ,bla ,bla)
{
     .......
     return 1;
}
Reply
#5

Quote:
Originally Posted by detter
Посмотреть сообщение
sorry i don't have that func. but it's very simple...
add 'return 1;' just before last '}'

Код:
stock ProxDetector(bla ,bla ,bla)
{
     .......
     return 1;
}
Oh yeah, I miss that tag, thank's before
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)