Scripting Errors !!
#1

When I am far away from an atm then I can't use /atm .. But When I get near an atm and then if i go far away .. I can use /atm .. I wanna fix this stupid bug .. I hope u understand my problem .. Here's my code :

Код:
#define DIALOG_ATM 43
Код:
	//ATM
	
	CreateObject(2942,-1571.30004883,712.79998779,6.80000019,0.00000000,0.00000000,90.00000000); //object(kmb_atm1) (1)
	CreateObject(2942,-1728.00000000,717.50000000,24.60000038,0.00000000,0.00000000,90.00000000); //object(kmb_atm1) (2)
	CreateObject(2942,-2018.50000000,752.29998779,45.09999847,0.00000000,0.00000000,90.00000000); //object(kmb_atm1) (3)
	CreateObject(2942,-2669.19995117,297.50000000,4.00000000,0.00000000,0.00000000,0.00000000); //object(kmb_atm1) (4)
	CreateObject(2942,-1965.29980469,462.79980469,34.79999924,0.00000000,0.00000000,179.99450684); //object(kmb_atm1) (5)
	CreateObject(2942,-1979.29980469,239.50000000,34.79999924,0.00000000,0.00000000,179.99450684); //object(kmb_atm1) (6)
	CreateObject(2942,-2210.50000000,-178.89941406,35.00000000,0.00000000,0.00000000,0.00000000); //object(kmb_atm1) (7)
	CreateObject(2942,-2593.19921875,94.09960938,4.00000000,0.00000000,0.00000000,0.00000000); //object(kmb_atm1) (8)
	CreateObject(2942,-2487.50000000,1218.59997559,34.79999924,0.00000000,0.00000000,142.00000000); //object(kmb_atm1) (9)
	CreateObject(2942,-2564.79980469,477.79980469,14.30000019,0.00000000,0.00000000,0.00000000); //object(kmb_atm1) (10)
	CreateObject(2942,-2240.79980469,789.19921875,49.00000000,0.00000000,0.00000000,275.99853516); //object(kmb_atm1) (11)
Код:
dcmd(atm,3,cmdtext);
Код:
dcmd_atm(playerid,params[])
{
	#pragma unused params
	if(IsSpawned[playerid] != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 1;
	}
	if(IsKidnapped[playerid] == 1)
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
	    return 1;
	}
	if(IsFrozen[playerid] == 1)
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You have been frozen by a Server Administrator. You cannot use this command.");
	    return 1;
	}
	if(IsPlayerInAnyVehicle(playerid))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command inside a vehicle");
	    return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -1571.30004883,712.79998779,6.80000019, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -1728.00000000,717.50000000,24.60000038, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2018.50000000,752.29998779,45.09999847, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2669.19995117,297.50000000,4.00000000, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -1965.29980469,462.79980469,34.79999924, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -1979.29980469,239.50000000,34.79999924, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2240.79980469,789.19921875,49.00000000, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2210.50000000,-178.89941406,35.00000000,1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2593.19921875,94.09960938,4.00000000, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2487.50000000,1218.59997559,34.79999924, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, -2564.79980469,477.79980469,14.30000019, 1))
	{
		ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
		return 1;
	}
	else (SendClientMessage(playerid, COLOR_ERROR, "You are not standing near an atm !!"));
	return 1;

}
Reply
#2

IsPlayerInRangeOfPoint

Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, /*this is X not range! */-1571.30004883,712.79998779,6.80000019, 1))
    {
        ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"ATM Options","Withdraw Money\nDeposit Money","Select","Cancel");
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)