Command help
#1

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
Reply
#2

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.
Reply
#3

how do i add it to my gm?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)