Doesn't detect vehicle as Ambulance
#1

Heya there SAMP scripters, I was wondering what's wrong in this code
This is a stretcher system im trying to script, although it detects every vehicle as Ambulance
(Command works even if im not near an ambulance)
Note: I am pretty sure the problem is in the for loop
Thanks in advice

PHP Code:
        new Float:XFloat:YFloat:ZFloat:A;
         
GetPlayerPos(playeridXYZ);
          
GetPlayerFacingAngle(playeridA);
        for(new 
i=0i<MAX_VEHICLESi++)
        {
            if(
IsPlayerNearVehicle(playeridi2) && IsLSFMDVehicle(i))
            {
                 
ambulance++;
                if(
ContainStretcher[i]) ambstretcher++;
            }
        }
        if(
ambulance 0) return SendClientMessage(playeridCOLOR_GREY"You are not near any ambulance.");
        if(
ambstretcher 0) return SendClientMessage(playeridCOLOR_GREY"This ambulance doesn't contain any stretcher.");
        if(
UsingStretcher[playerid]) return SendClientMessage(playeridCOLOR_GREY"You are already using a stretcher.");
         
UsingStretcher[playerid] = 1;
        
StretcherObj[playerid] = CreateObject(2146XYZ00A100.0);
         
MovingStretcher[playerid] = 1;
          
AttachObjectToPlayer(StretcherObj[playerid], playerid0.001.30, -0.500.00.00.0);
        
format(stringsizeof(string), "* %s opens the back of the ambulance and withdraws a stretcher."RPN(playerid));
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE); 
Reply


Messages In This Thread
Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 00:07
Re: Doesn't detect vehicle as Ambulance - by Godey - 13.04.2016, 00:50
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 00:54
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 12:53
Re: Doesn't detect vehicle as Ambulance - by Godey - 13.04.2016, 12:57
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 14:02
Re: Doesn't detect vehicle as Ambulance - by ConnorHunter - 13.04.2016, 14:53
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 14:59
Re: Doesn't detect vehicle as Ambulance - by ConnorHunter - 13.04.2016, 15:01
Re: Doesn't detect vehicle as Ambulance - by Karan007 - 13.04.2016, 15:12
Re: Doesn't detect vehicle as Ambulance - by ConnorHunter - 13.04.2016, 15:17
Re: Doesn't detect vehicle as Ambulance - by Padevex - 13.04.2016, 15:18
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 16:08
Re: Doesn't detect vehicle as Ambulance - by ConnorHunter - 13.04.2016, 17:05
Re: Doesn't detect vehicle as Ambulance - by NeXoR - 13.04.2016, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)