help using "if" with an array
#1

Can someone tell me if i have set this bit of code out properly?
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(gion[playerid] == 1) return 0;
        if(gipassenger[playerid] == 0) return 0;
        PutPlayerInVehicle(playerid, vehicleid, 0);
	if(gipassenger[playerid] == 1) return 0;
	PutPlayerInVehicle(playerid, vehicleid, 15);
	return 1;
}
It works if i do;
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(gion[playerid] == 1) return 0;
        PutPlayerInVehicle(playerid, vehicleid, 0);
	return 1;
}
Reply
#2

*Bump* I NEED this fixing soon!!
Reply
#3

I know that you think it's an emergency but you know there some rules here:
Quote:
Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.

And now you should probably test it and see if it works, and if it doesn't that post what you think it's the problem and then we can help you.
Oh yeah, one more thing, don't use "if" everywhere, first put "if" and then "else if" .

You can look here for more info.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)