SA-MP Forums Archive
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)
+--- Thread: Help.. (/showthread.php?tid=327771)



Help.. - jimis - 22.03.2012

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


Re: Help.. - [MG]Dimi - 22.03.2012

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.


Re: Help.. - jimis - 22.03.2012

Thanks


Re: Help.. - Bogdan1992 - 22.03.2012

nvm xD


Re: Help.. - jimis - 22.03.2012

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


Re: Help.. - [MG]Dimi - 22.03.2012

Which command processor?


Re: Help.. - AlTy - 22.03.2012

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");
}



Re: Help.. - SpardaHD - 22.03.2012

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>>");



Re: Help.. - jimis - 22.03.2012

οκ,thanks guys ,its work