need help with command
#1

how do i make a command that when you do /pay on the checkpoint and it will take away like 2000 cash and the gate will open please help
Reply
#2

pawn Код:
if(!strcmp("/pay",cmdtext))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, YourX, YourY, YourZ)) //7.0 is the range
    {
        GivePlayerMoney(playerid, -2000);
        SendClientMessage(playerid,0xFFFFFFFF,"Gate opening!");
        //MoveObject...
    }
    return 1;
}
Reply
#3

Then how about the taking away thier money? and nice signature
Reply
#4

pawn Код:
GivePlayerMoney(playerid, -2000);

Takes away their 2k. btw if you do this without a check it will go negative.
Reply
#5

Could as well be with the check:

pawn Код:
if(!strcmp("/pay",cmdtext))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, YourX, YourY, YourZ)) //7.0 is the range
    {
        if(GetPlayerMoney(playerid)>2000)
        {
            GivePlayerMoney(playerid, -2000);
            SendClientMessage(playerid,0xFFFFFFFF,"Gate opening!");
            //MoveObject...
            return 1;
         }
         else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You need 2000$ to open the gate!");
    }
    else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You need to be near the gate to open it!");
}
Just pick the one you want, and don't forget to fill in your coords. ^^
Reply
#6

Thanks mate
Reply
#7

and can you make a signature almost like yours JEFFRY just the name change to mine and the women change to more prettier girl please if you can do it
Reply
#8

I didn't made the signature, a friend made it. Sorry. :P
Reply
#9

Could you ask him to make for me
Reply
#10

Quote:
Originally Posted by LegendNissanGTR
Посмотреть сообщение
Could you ask him to make for me
Sorry, but I dont want to annoy him with requests of anyone. If it start it once, everybody asks me to ask him. Sry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)