SA-MP Forums Archive
Command help - 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: Command help (/showthread.php?tid=185039)



Command help - Tom1412 - 23.10.2010

HI,

Im learning how to script, so i need some help.
I want to know if anyone nows how to make a command, when they are at a gate they type /pay and they lose 20$
and the gate opens for them.

can somebody help me.

for more infomation email me with ur questions at tom.1412@hotmail.com

-thanx Tom.s


Re: Command help - zack3021 - 23.10.2010

Here is one i just made but it is not tested. I made it with strmp cuz idk if you use zcmd.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/pay", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,x,y,z))return SendClientMessage(playerid,PUT THE COLOR HERE,"You are too far from the gate to pay");
        if(GetPlayerMoney(playerid, < 500))return SendClientMessage(playerid,PUT THE COLOR HERE,"You do not have enough money");
        if(GetPlayerMoney(playerid, > 500))return SendClientMessage(playerid,PUT THE COLOR HERE,"You have just paid and the gate is open");
        {
        MoveObject(objectid,x,y,z,2.0)
        }
        return 1;
    }
    return 0;
}
Where you see x,y,z (for IsPlayerInRangOfPoint) you need to put the co-ords there and same for MoveObject.


Re: Command help - Tom1412 - 23.10.2010

how do i add it to my gm?