/money or /setmoney doesn't work...need 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: /money or /setmoney doesn't work...need help (
/showthread.php?tid=78398)
/money or /setmoney doesn't work...need help -
Tobii - 19.05.2009
If I use /money [my-id] 10000 to set my money to 10,000
there were a bug.
ok If i have 0$ and my id is 0 i will type /money 0 10000
to set my money to 10000 (not /givemoney) my money will goto 10,000$
and then back to 0$.
What could i do to fix the bug ?? (its a german server
Thanks for your help.
Код:
if(strcmp(cmd, "/money", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /money [playerid/PartOfName] [money]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
ResetPlayerMoney(playa);
ConsumingMoney[playa] = 1;
PlayerMoney[playa] += money;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nicht fьr dich - MFG TOBI!");
}
}
return 1;
}
Re: /money or /setmoney doesn't work...need help -
MenaceX^ - 19.05.2009
pawn Код:
PlayerMoney[playa] += money;
Show me this function.
Re: /money or /setmoney doesn't work...need help -
Slice - 19.05.2009
Omg it's you! The guy that were chasing me with a rustler for one hour on Littlewhitey's.
Anways, use this to set playa's money to whatever the money variable is set to.
Код:
GivePlayerMoney( playa, money - GetPlayerMoney( playa ) );
Re: /money or /setmoney doesn't work...need help -
Tobii - 20.05.2009
Can you send me the ful script please
i don't know where i must put this in...
Thanks for your help
Re: /money or /setmoney doesn't work...need help -
Tobi2503 - 21.05.2009
What must i do to fix this bug ?