Gate Problem..
#1

So i have made some gates and when i go near them and type the cmd they don't open/close.. anyone help?

The code:
Код:
new adgarage;
new vipgarage;
new vipgarage3
Код:
COMMAND:adopen(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(7, playerid, 1620.6000000, -1862.1000000, 15.3000000))
		{
	   		if(APlayerData[playerid][PlayerLevel] >= 1)
	        {
	        	MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000000, 2);
				SendClientMessage(playerid, -1, "Gate Opened");
			}
		}
	return 1;
}
Код:
COMMAND:adclose(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(7, playerid, 1620.6000000, -1862.1000000, 15.3000000))
		{
	   		if(APlayerData[playerid][PlayerLevel] >= 1)
	        {
	        	MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000000, 2);
				SendClientMessage(playerid, -1, "Gate Closed");
			}
		}
	return 1;
}
Код:
adgarage = CreateObject(980,1620.6000000,-1862.1000000,15.3000000,0.0000000,0.0000000,0.0000000); //gate 2 ata !!!
Код:
COMMAND:vopen(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(7, playerid, 1644.1000000, -1713.7000000, 16.4000000))
		{
	   		if(pInfo[playerid][vStatus] >= 1)
	        {
	        	MoveObject(vipgarage, 1644.1000000, -1713.7000000, 16.4000000, 2);
				SendClientMessage(playerid, -1, "Gate Opened");
			}
		}
	return 1;
}
Код:
COMMAND:vclose(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(7, playerid, 1644.1000000, -1713.7000000, 16.4000000))
		{
	   		if(pInfo[playerid][vStatus] >= 1)
	        {
	        	MoveObject(vipgarage, 1644.1000000, -1713.7000000, 16.4000000, 2);
				SendClientMessage(playerid, -1, "Gate Closed");
			}
		}
	return 1;
}
Код:
vipgarage3 = CreateObject(980,1284.2000000,-2056.3000000,60.5000000,0.0000000,0.0000000,90.0000000); //gate 1 ata !!!
Код:
vipgarage = CreateObject(980,1644.1000000,-1713.7000000,16.4000000,0.0000000,0.0000000,90.0000000); //gate 3 ata !!!
Reply
#2

try this , and read what i've said

PHP код:
COMMAND:adopen(playeridparams[])
{
    if(
IsPlayerInRangeOfPoint(playerid71620.6000000, -1862.100000015.3000000))
        {
               if(
APlayerData[playerid][PlayerLevel] >= 1)
            {
                
MoveObject(adgarage1620.6000000, -1862.100000015.30000002);  // i cant see the finaly posstion  x , y , z ?? 
                
SendClientMessage(playerid, -1"Gate Opened");
            }
        }
    return 
1;

Note : !! //MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)

Note 2 : after you'll put the finaly x y z , test and do the work for all your commands (open/close commands just )
Reply
#3

pawn Код:
MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000000, 2);
pawn Код:
MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000000, 2);
You're using the same coordinates for opening/closing. How do you expect these to move if the coordinates aren't changing? You're moving them to the exact same position they're in.

Код:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)
There are additional 'rotation' parameters if that's what you're looking for. But take note that you have to MOVE the object as well for the rotation to show. Otherwise the object just cuts to the rotation and no 'movement' occurs.

Example:
Opening
pawn Код:
MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000001, 2, 0.0, 0.0, 90.0);
Closing
pawn Код:
MoveObject(adgarage, 1620.6000000, -1862.1000000, 15.3000000, 2, 0.0, 0.0, 0.0);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)