Help with a command.
#1

I created a Garage system for my server but when making /entergarage command i got some problem however it compiles well the cmd totally doesnt work IG.Here is the cmd code
Код:
CMD:entergarage(playerid, params[])
{
	new gInt, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	for(new idx=0; idx<MAX_GARAGES; idx++) // Garage Int
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
	    if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx && PlayerInfo[playerid][pVGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked by its owner.");
	    {
	        if(GarageInfo[idx][gInt])
	        {
	            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
				TogglePlayerControllable(playerid, 0);
	            SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	            PlayerInfo[playerid][pSpawnFreeze] = 1;
	        }
	        if(HouseInfo[idx][hLevel] == 1)
	        {
		        PlayerInfo[playerid][pSpawnFreeze] = 0;
		        SetPlayerInterior(playerid, 1);
		        SetPlayerVirtualWorld(playerid, idx+100);
		        SetPlayerFacingAngle(playerid, 357.5915);
		        SetCameraBehindPlayer(playerid);
		        SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
 			}
	        return 1;
	    }
	}
	return 1;
}
Reply
#2

BUMP!
Reply
#3

Try increasing the distance of isplayerinrangeofpoiny to like 10 and test it.
Reply
#4

Didnt Help.
Reply
#5

Your best bet is to debug it.
Reply
#6

I'm not sure if this has any importance, but I notice you're returning 1 (true) twice in that command. Perhaps that is causing problems?

Код:
CMD:entergarage(playerid, params[])
{
	new gInt, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	for(new idx=0; idx<MAX_GARAGES; idx++) // Garage Int
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
	    if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx && PlayerInfo[playerid][pVGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked by its owner.");
	    {
	        if(GarageInfo[idx][gInt])
	        {
	            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
				TogglePlayerControllable(playerid, 0);
	            SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	            PlayerInfo[playerid][pSpawnFreeze] = 1;
	        }
	        if(HouseInfo[idx][hLevel] == 1)
	        {
		        PlayerInfo[playerid][pSpawnFreeze] = 0;
		        SetPlayerInterior(playerid, 1);
		        SetPlayerVirtualWorld(playerid, idx+100);
		        SetPlayerFacingAngle(playerid, 357.5915);
		        SetCameraBehindPlayer(playerid);
		        SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
 			}
	        return 1;
	    }
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)