CMD:hood (it was working before, not anymore) ;_;
#1

Hello, i made a command "hood" before, it was working before, but now it isnt working anymore.
Here's the command:
Код:
CMD:hood(playerid, params[])
{
	for (new i = 1; i != MAX_VEHICLES; i ++) if (IsValidVehicle(i) && IsPlayerNearHood(playerid, i))
	{
	    if (!IsDoorVehicle(i))
	        return SendClientMessage(playerid, -1,  "{FF0000}Error:{FFFFFF}This Vehicle Doesn't Have Hood.");

	    if (!GetHoodStatus(i))
		{
	        SetHoodStatus(i, true);
	        SendClientMessage(playerid, -1, "You Have {00FF40}Opened{FFFFFF} The Hood");		
		}
		else
		{
		SetHoodStatus(i, false);
		SendClientMessage(playerid, -1, "You Have {FF0000}Closed {FFFFFF}The Hood");			  
		}
	    return 1;
	}
	SendClientMessage(playerid, -1, "{FF0000}Error:{FFFFFF}You Are Not In Range Of Any Vehicle");
	return 1;
}
This does not shows any error or warnings.

This will work if m near or at a vehicle with no door. (i.e any bike).

But when im near any car which has door, or hood. It will simply say you're not in range of any vehicle.

it was working before as it is, but doesnt work now.
Reply
#2

REMOVED
Reply
#3

Still need help though.
Reply
#4

Anyone? :/
Reply
#5

PHP код:
CMD:hood(playeridparams[])
{
    for (new 
1!= MAX_VEHICLES++) if (IsValidVehicle(i) && IsPlayerNearHood(playeridi))
    {
        if (!
IsDoorVehicle(i))
            return 
SendClientMessage(playerid, -1,  "{FF0000}Error:{FFFFFF}This Vehicle Doesn't Have Hood.");
        if (!
GetHoodStatus(i))
        {
            
SetHoodStatus(itrue);
            
SendClientMessage(playerid, -1"You Have {00FF40}Opened{FFFFFF} The Hood");        
        }
        else
        {
        
SetHoodStatus(ifalse);
        
SendClientMessage(playerid, -1"You Have {FF0000}Closed {FFFFFF}The Hood");              
        }
    }
    else 
SendClientMessage(playerid, -1"{FF0000}Error:{FFFFFF}You Are Not In Range Of Any Vehicle");
    return 
1;

I wish this gonna work try it out
Reply
#6

No, m pretty sure this wont work. the loop isnt ending it will spam the message.

wait, let me test.

Yes, spammed my chat.
Reply
#7

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
No, m pretty sure this wont work. the loop isnt ending it will spam the message.

wait, let me test.

Yes, spammed my chat.
would you tell me which message has spammed your chat?
Reply
#8

Код:
SendClientMessage(playerid, -1, "{FF0000}Error:{FFFFFF}You Are Not In Range Of Any Vehicle");
spam message = MAX_VEHICLES

for example, my max vehicle is 20, so this message comes 20 times.

(it came 305 times now though)
Reply
#9

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
Код:
SendClientMessage(playerid, -1, "{FF0000}Error:{FFFFFF}You Are Not In Range Of Any Vehicle");
spam message = MAX_VEHICLES

for example, my max vehicle is 20, so this message comes 20 times.

(it came 305 times now though)
can you show me your IsPlayerNearHood?
Reply
#10

Код:
stock IsPlayerNearHood(playerid, vehicleid)
{
	static
		Float:fX,
		Float:fY,
		Float:fZ;

	GetVehicleHood(vehicleid, fX, fY, fZ);

	return (GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(vehicleid)) && IsPlayerInRangeOfPoint(playerid, 6.0, fX, fY, fZ);
}
i'm pretty sure this isn't the issue, because i use this stock in mechanic skill too. No issue there.

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 50 seconds.

kalkor pls
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)