Problem with check bool
#1

should spawn car when bool value is true and if false, unspawn but vehicle always spawn
whats wrong

Код:
        new bool:veh1spawned[MAX_PLAYERS]; //global
        new Float:x, Float:y, Float:z, Float:angle;
        new Float:x2, Float:y2;
        new vehid[MAX_PLAYERS];

//case in dialog response
                    if(veh1spawned[playerid] == false)
                    {
	                    veh1spawned[playerid] = true;
						GetXYInFrontOfPlayer(playerid, x, y, 10.0);
						GetPlayerPos(playerid, x2, y2, z);
						GetPlayerFacingAngle(playerid, angle);
						vehid[playerid] = CreateVehicle(Veh1[playerid], x, y, z, angle+90, 0, 0, -1);
						SetPVarInt(playerid, "veh1spawned", Veh1[playerid]);
					}else if(veh1spawned[playerid] == true)
					{
					    veh1spawned[playerid] = false;
					    DestroyVehicle(vehid[playerid]);
					}

//opc
	if(veh1spawned[playerid] == true)
	{
	    veh1spawned[playerid] = false;
	    DestroyVehicle(GetPVarInt(playerid, "Veh1spawned"));
	}

//opd
	if(veh1spawned[playerid] == true)
	{
	    veh1spawned[playerid] = false;
	    DestroyVehicle(GetPVarInt(playerid, "Veh1spawned"));
	}
//edit
so if i add sendclientmessage after true or false such as 'vehicle spawned' or 'vehicle unspawned' it will be displayed correctly.
Reply


Messages In This Thread
Problem with check bool - by cnoopers - 07.07.2014, 10:37
Re: Problem with check bool - by cnoopers - 07.07.2014, 11:37
Re: Problem with check bool - by cnoopers - 07.07.2014, 13:40
Re: Problem with check bool - by ShinichiKudou - 07.07.2014, 14:08
Re: Problem with check bool - by cnoopers - 07.07.2014, 14:14
Re: Problem with check bool - by ShinichiKudou - 07.07.2014, 14:23
Re: Problem with check bool - by cnoopers - 07.07.2014, 14:31
Re: Problem with check bool - by ShinichiKudou - 07.07.2014, 14:40
Re: Problem with check bool - by cnoopers - 07.07.2014, 14:48
Respuesta: Re: Problem with check bool - by Siralos - 07.07.2014, 14:52
Re: Problem with check bool - by ShinichiKudou - 07.07.2014, 14:54
Re: Problem with check bool - by cnoopers - 07.07.2014, 14:54
Respuesta: Problem with check bool - by Siralos - 07.07.2014, 15:02
Re: Problem with check bool - by cnoopers - 07.07.2014, 15:15
Respuesta: Problem with check bool - by Siralos - 07.07.2014, 15:29
Re: Problem with check bool - by cnoopers - 07.07.2014, 15:36
Re: Problem with check bool - by cnoopers - 07.07.2014, 16:53
Re: Problem with check bool - by cnoopers - 07.07.2014, 18:59
Re: Problem with check bool - by cnoopers - 08.07.2014, 09:08

Forum Jump:


Users browsing this thread: 2 Guest(s)