stock warning
#1

Weird, just made this!

pawn Код:
stock KickWhenNotRegister(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To play here, you must register an account here! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
}

stock KickWhenNotLoggedIn(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To continue your session, it's necesscary to login to your account! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
}
The use of these thing is at
pawn Код:
if(!response) return KickWhenNotRegister(playerid);
if(!response) return KickWhenNotLoggedIn(playerid);
Errors:
Код:
B:\NewProject\gamemodes\CnR.pwn(418) : warning 209: function "KickWhenNotRegister" should return a value
B:\NewProject\gamemodes\CnR.pwn(448) : warning 209: function "KickWhenNotLoggedIn" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Any ideas to fix this? (Need to do this gamemode fast, this problem got my stuck for some minutes, still can't figure it out what's wrong. Checked this errors for thrice...
Reply
#2

pawn Код:
stock KickWhenNotRegister(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To play here, you must register an account here! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
    return 1;
}

stock KickWhenNotLoggedIn(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To continue your session, it's necesscary to login to your account! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
    return 1;
}
If it must return a value, then you need to return a value... it's not that hard to understand.
Reply
#3

You can either use:
pawn Код:
if(!response)
{
    KickWhenNotRegister(playerid);
    return 1;
}
pawn Код:
if(!response)
{
    KickWhenNotLoggedIn(playerid);
    return 1;
}
since it does not return any value or:
pawn Код:
stock KickWhenNotRegister(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To play here, you must register an account here! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
    return 1;
}

stock KickWhenNotLoggedIn(playerid)
{
    SendClientMessage(playerid, -1, "{ff0000}=KICKED=: {ffffff}To continue your session, it's necesscary to login to your account! Sorry!");
    SetTimerEx("KickWithMsg", 1000, 0, "d", playerid);
    return 1;
}
with:
pawn Код:
if(!response) return KickWhenNotRegister(playerid);
if(!response) return KickWhenNotLoggedIn(playerid);
Reply
#4

Oops, my bad, seems I'm sleepy and needs to get a coffee tonight, thanks for helping! +repped both and will see these things as a lesson.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)