SA-MP Forums Archive
[Help]Area 51 Gates Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help]Area 51 Gates Problem (/showthread.php?tid=103381)



[Help]Area 51 Gates Problem - Tigerbeast11 - 19.10.2009

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 ...



Re: [Help]Area 51 Gates Problem - dice7 - 19.10.2009

Test it '-.-


Re: [Help]Area 51 Gates Problem - Peter_Corneile - 19.10.2009

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


Re: [Help]Area 51 Gates Problem - dice7 - 19.10.2009

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


Re: [Help]Area 51 Gates Problem - Pghpunkid - 19.10.2009

Does it open correctly?


Re: [Help]Area 51 Gates Problem - Peter_Corneile - 19.10.2009

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


Re: [Help]Area 51 Gates Problem - Peter_Corneile - 19.10.2009

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


Re: [Help]Area 51 Gates Problem - Pghpunkid - 19.10.2009

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.


Re: [Help]Area 51 Gates Problem - Peter_Corneile - 19.10.2009

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"


Re: [Help]Area 51 Gates Problem - Pghpunkid - 19.10.2009

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.