Return problem ? I think
#1

I start edit a rp gamemode and i make another cars for police and another factions, but when a player enter a vehicle it's check if the car is a CopCar or another faction....The problem is the function that was in gm(i edit because i made alot of cars and was a waste of time to put all in the row) it's not returning what suppose to

OnPlayerStateChange:
PHP код:
if(IsACopCar(newcar))
        {
            if(
IsACop(playerid)) { }
            else { 
RemovePlayerFromVehicleEx(playerid); SendClientMessage(playerid,COLOR_WHITE"{999999}You are not a Cop."); }
        } 
IsACopCar function:
PHP код:
public IsACopCar(carid)
{
    for(new 
1,j=81ji++)
    {
        if(
carid == Copcar[i])
        {
            return 
1;
        }
        else
            return 
0;
    }
    return 
1;

The cause may be the last return or? Because i don't get it.....If i delete him give the warning of function need to have return value....
Reply


Messages In This Thread
Return problem ? I think - by Banditul18 - 02.04.2017, 19:15
Re: Return problem ? I think - by Toroi - 02.04.2017, 19:36
Re: Return problem ? I think - by Vince - 02.04.2017, 19:48
Re: Return problem ? I think - by GangstaSunny. - 02.04.2017, 19:54
Re: Return problem ? I think - by Banditul18 - 02.04.2017, 19:56
Re: Return problem ? I think - by Vince - 03.04.2017, 05:33
Re: Return problem ? I think - by GangstaSunny. - 03.04.2017, 08:08

Forum Jump:


Users browsing this thread: 1 Guest(s)