Multiple 'if' statements problem
#1

Hello, i am kind of a noob at this stuff as im only 12 years old XD (dont pay me out) ive been coding in pawno for about a year now and ive made a little server for me and my friends. I have a stunter class that just does stunts and i want just that team to be able to do /repair to repair their vehicle, but to do that i need to use 2 if statements
Код:
 if(gTeam[playerid] == TEAM_STUNTS
and
Код:
 if(!IsPlayerInAnyVehicle(playerid))
But i have absolutely no idea on how to call the second if statement after the first (like to check if a player is in a vehicle after it has checked if they are on the stunter team) this is my public OnPlayerCommandText code.


Код:
 			public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/stunts", cmdtext, true, 10) == 0)
	{
		if(gTeam[playerid] == TEAM_STUNTS)
		{
			SetPlayerPos(playerid, 1593.85059,2502.72729,578.09845);
		}
		else SendClientMessage(playerid,0xAA3333AA,"You must be on the stunter team to teleport to the stunter spawn!");
	}

    if (!strcmp("/repair", cmdtext))
    {
  		if(gTeam[playerid] == TEAM_STUNTS)
        if(!IsPlayerInAnyVehicle(playerid))
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, COLOR_GREEN, "Your vehicle has been repaired!");
        return 1;
    }
}
As you can see i have no idea lol. Please help all you can

-Nacho
Reply


Messages In This Thread
[SOLVED] Multiple 'if' statements problem - by thenachoman180 - 07.10.2012, 00:23
AW: Multiple 'if' statements problem - by Nero_3D - 07.10.2012, 00:31
Re: AW: Multiple 'if' statements problem - by thenachoman180 - 07.10.2012, 00:37
Re: Multiple 'if' statements problem - by thenachoman180 - 07.10.2012, 00:41
AW: Multiple 'if' statements problem - by Nero_3D - 07.10.2012, 01:02
Re: Multiple 'if' statements problem - by RedFusion - 07.10.2012, 01:03
Re: Multiple 'if' statements problem - by thenachoman180 - 07.10.2012, 01:05

Forum Jump:


Users browsing this thread: 1 Guest(s)