Problem with tolls [/gate]
#1

Hello,

I'm trying to edit a roleplay script and I've tried to add tolls no luck so far. I mapped the closed tolls and inserted them into my GM. Compiling it generates no errors.

I'm using the following command:

Код:
CMD:gate(playerid, params[])
{
    new string[128];
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
	{
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetDynamicObjectPos(LSPDGate, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetDynamicObjectPos(LSPDGate2, Positions[4][0], Positions[4][1], Positions[4][2]);
        GetDynamicObjectPos(SASPGate1, Positions[6][0], Positions[6][1], Positions[6][2]);
        GetDynamicObjectPos(SASPGate2, Positions[7][0], Positions[7][1], Positions[7][2]);
        GetDynamicObjectPos(SASPGate3, Positions[8][0], Positions[8][1], Positions[8][2]);
        GetDynamicObjectPos(FBIGate1, Positions[2][0], Positions[2][1], Positions[2][2]);
        GetDynamicObjectPos(FBIGate2, Positions[3][0], Positions[3][1], Positions[3][2]);
        GetDynamicObjectPos(NGGate, Positions[5][0], Positions[5][1], Positions[5][2]);
       	GetDynamicObjectPos(SADPSGate1, Positions[9][0], Positions[9][1], Positions[9][2]);
        GetDynamicObjectPos(SADPSGate2, Positions[10][0], Positions[10][1], Positions[10][2]);
        GetDynamicObjectPos(SADPSGate3, Positions[11][0], Positions[11][1], Positions[11][2]);
        GetDynamicObjectPos(nationalGATE, Positions[12][0], Positions[12][1], Positions[12][2]);
        GetDynamicObjectPos(nationalGATE2, Positions[13][0], Positions[13][1], Positions[13][2]);
        GetDynamicObjectPos(prisontoll1, Positions[14][0], Positions[14][1], Positions[14][2]);
        
		if(IsPlayerInRangeOfPoint(playerid, 8.0, 942.76953125,-2378.83496094,12.78274250)) {
            if(prisontoll1Status == 0 ) {
                format( string, sizeof( string ), "* %s uses their remote to open the tolls.", GetPlayerNameEx( playerid ) );
                ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                MoveDynamicObject(prisontoll1, 942.76953125,-2378.83496094,12.78274250, 4);
                prisontoll1Status = 1;
            }
            else {
                prisontoll1Status = 0;
                MoveDynamicObject(prisontoll1, 942.84277344,-2378.94042969,12.85774136, 4);
                format( string, sizeof( string ), "* %s uses their remote to close the tolls.", GetPlayerNameEx( playerid ) );
                ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }

... rest of the gates/tolls which work
The problem is the tolls wont open (they're in closed position) though I receive the ' PLAYERNAME uses their remote to open the tolls.' message. What am I doing wrong here?

Thanks in advice,
Reply
#2

Fixed it:
Код:
		if(IsPlayerInRangeOfPoint(playerid, 8.0, 942.76953125,-2378.83496094,12.78274250)) {
            if(prisontoll1Status == 0 ) {
                format( string, sizeof( string ), "* %s uses their remote to open the tolls.", GetPlayerNameEx( playerid ) );
                ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SetDynamicObjectRot(prisontoll1, 0.000000, 0, 90);
                prisontoll1Status = 1;
            }
            else {
                prisontoll1Status = 0;
                SetDynamicObjectRot(prisontoll1, 0.000000, 90, 90);
                format( string, sizeof( string ), "* %s uses their remote to close the tolls.", GetPlayerNameEx( playerid ) );
                ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
Reply
#3

... Was wrong sorry
Reply
#4

No prob
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)