[Help]Area 51 Gates Problem
#1

Hi guys!

I have this script:
pawn Код:
if(strcmp(cmdtext, "/areagateclose", true) == 0)
  {
        if(IsPlayerLAdmin(playerid))
        {
            new pName[MAX_PLAYER_NAME];
        new string[48];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "%s has closed the Area 51 Gate", pName);
        SendClientMessageToAll(COLOR_RED, string);

            MoveObject(aGate2, 96.669350, 1925.953735, 18.855873, 4);
        return 1;
        }
        else
          {
            SendClientMessage(playerid, COLOR_RED,"You are not an admin");
                return 1;
            }
    }
    return 0;
But I don't think it will work... Is there something wrong that I am doing... I think I might have the return 1; in the wrong place... I don't know, this is my first 'written by myself' script ...
Reply
#2

Test it '-.-
Reply
#3

Try this
pawn Код:
if(strcmp( "/areagateclose",cmdtext ,true,14) == 0)
  {
        if(IsPlayerLAdmin(playerid))
        {
            new pName[MAX_PLAYER_NAME];
        new string[48];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "%s has closed the Area 51 Gate", pName);
        SendClientMessageToAll(COLOR_RED, string);

            MoveObject(aGate2, 96.669350, 1925.953735, 18.855873, 4);
        return 1;
        }
        else
          {
            SendClientMessage(playerid, COLOR_RED,"You are not an admin");
                return 1;
            }
    }
    return 0;
In your code you had "cmdtext" before the /areagateclose , that must be the reason why its not working
Reply
#4

It's the same thing if you have cmdtext as the first or second parameter
Reply
#5

Does it open correctly?
Reply
#6

Quote:
Originally Posted by dice7
It's the same thing if you have cmdtext as the first or second parameter
Ahh kk
Reply
#7

Oh i got it .. You have used return 0 in the command .. Change the return 0 to return 1
Reply
#8

Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Oh i got it .. You have used return 0 in the command .. Change the return 0 to return 1
That wouldnt affect the gate movement. that return 0 is the end of OnPlayerCommandText.
Reply
#9

Quote:
Originally Posted by Pghpunkid
Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Oh i got it .. You have used return 0 in the command .. Change the return 0 to return 1
That wouldnt affect the gate movement.
But still it may give him the message "Server : Unknown Command"
Reply
#10

Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Quote:
Originally Posted by Pghpunkid
Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Oh i got it .. You have used return 0 in the command .. Change the return 0 to return 1
That wouldnt affect the gate movement.
But still it may give him the message "Server : Unknown Command"
Thats not what his problem is.

TigerBeast11: Verify that the coords in moveobject are the closed gate position.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)