Help..
#1

How i can take from player money? For example if he type /sultan then he will lose 10000$.But if player haven't 10000$ on it the he will cant buy the sultan.
How to make it?

And something else.How i can make command...For example if a player type an uknown command the he will see at chat <<[Server]Uknown command please type /help>> ??


Thanks for help
Reply
#2

pawn Код:
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,-1,"You don't have enough money!");
GivePlayerMoney(playerid,-10000);
So to get money from player do GivePlayerMoney but put '-' before value.
Reply
#3

Thanks
Reply
#4

nvm xD
Reply
#5

And something else.How i can make command...For example if a player type an uknown command the he will see at chat <<[Server]Uknown command please type /help>> ??
Reply
#6

Which command processor?
Reply
#7

for normal processor

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/blabla", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Blabla");
        return 1;
    }
    return 0;
}
Replace with

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/blabla", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Blabla");
        return 1;
    }
    return SendClientMessage(playerid, 0xFFFFFFFF, "Wrong command. Blah Blah Blah");
}
Reply
#8

Ok At the End Of OnPlayerCommandText Callback

you will see Return 0

Just Replace YOur
Return 0;

With This Code
Код:
return SendClientMessage(playerid,COLOR_RED,"<<[Server]Uknown command please type /help>>");
Reply
#9

οκ,thanks guys ,its work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)