SA-MP Forums Archive
Money scripting - 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: Money scripting (/showthread.php?tid=409488)



Money scripting - SonOussi - 21.01.2013

I want that the players begin with 5000 $ and can give money to others


Re: Money scripting - SonOussi - 21.01.2013

Someon ?


Re: Money scripting - [XST]O_x - 21.01.2013

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerMoney(playerid, GetPlayerMoney(playerid) + 5000);
    return 1;
}



AW: Money scripting - Blackazur - 21.01.2013

On "OnPlayerSpawn":

Quote:

GivePlayerMoney(playerid,5000);

Код:
COMMAND:pay(playerid,params[])
{
new id, betrag;
if(sscanf(params,"dd",id,betrag)) return NoSuccess(playerid,"Usage /pay id amount");
if(!IsPlayerConnected(id)) return NoSuccess(playerid,"player is not connected!");
if(betrag < 0) return NoSuccess(playerid,"Amount cannot be under 0!");
if(GetPlayerMoney(playerid) < betrag) return NoSuccess(playerid,"dont have so much money!");

GivePlayerMoney(playerid,-betrag);
GivePlayerMoney(id,betrag);
return 1;
}



Re: Money scripting - SonOussi - 21.01.2013

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerMoney(playerid, GetPlayerMoney(playerid) + 5000);
    return 1;
}
Im getting this error 017: undefined symbol "SetPlayerMoney"


AW: Money scripting - Blackazur - 21.01.2013

SetPlayerMoney dont exist use my Code.

Код:
GivePlayerMoney(playerid,5000);



Re: Money scripting - SonOussi - 21.01.2013

Oke works , but how to give player money like this : /giveplayermoney [ID] 200 $


AW: Money scripting - Blackazur - 21.01.2013

from player money to player money or with an admin command where you can give people random money? when from player money to player money, then use my code i posted above.


Re: Money scripting - SonOussi - 21.01.2013

have done but get this warning "pay"


AW: Money scripting - Blackazur - 21.01.2013

Post the exact Pawn Code, then i get not a Warning.