Stock Function - Simple - Yes Or No Answer
#2

Not really.. it doesn't return anything.

If you don't want a 'function IsACop must return a value' warning, this will be the right code:

pawn Код:
stock IsACop(playerid)
{
    if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
    {
        SendClientMessage(playerid,COLOR_RED,"Law Enforcement Officers Cannot Rob Places");
    }
    return 1;
}
Everything else is fine. I have a similar function in my script (with the gTeam crap too), so yeah, the code above WILL work, but your current IsACop should be replaced with mine to avoid any problems, or just put

pawn Код:
return 1;
Before the very last } in the function.
Reply


Messages In This Thread
Stock Function - Simple - Yes Or No Answer - by xMichaelx - 08.12.2011, 02:26
Re: Stock Function - Simple - Yes Or No Answer - by Emmet_ - 08.12.2011, 02:40
Re: Stock Function - Simple - Yes Or No Answer - by xMichaelx - 08.12.2011, 02:49
Re: Stock Function - Simple - Yes Or No Answer - by Emmet_ - 08.12.2011, 03:03
Re: Stock Function - Simple - Yes Or No Answer - by xMichaelx - 08.12.2011, 03:11

Forum Jump:


Users browsing this thread: 1 Guest(s)