[HELP] GetPlayerMoney [Posible/Not?] - 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: [HELP] GetPlayerMoney [Posible/Not?] (
/showthread.php?tid=277333)
[HELP] GetPlayerMoney [Posible/Not?] -
DeadDon - 17.08.2011
Hi guys, im using my own script to make some cool things.
I do not know if this is posible or not. Here is the thing:
Im trying using GetPlayerMoney Function to find out how much money has the player1 and his money goes to player2. Now, here is the problem; I do not know how to use this function.
I ******d it, Wiki-Searched and... nothing.
So I would like you to help me if you can.
If you dont understand me, just look at the script
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new killer[129],killed[129];
new Float:money;
GetPlayerName(killerid,killer,sizeof(killer));
GetPlayerName(playerid,killed,sizeof(killed));
GetPlayerMoney(playerid,money);
if(IsInMini[playerid] == 1)
{
new killmsg[129];
new paremsg[129];
format(killmsg,sizeof(killmsg),"{008080} %s je ubio %s dvoboju,",killer,killed);
SendClientMessageToAll(0xFFF000FF,killmsg);
format(paremsg,sizeof(paremsg),"{008080} te uzeo njegovihg {009400} %s {008080}.",money);
SendClientMessageToAll(0xFFF000FF,paremsg);
GivePlayerMoney(killerid,money);
GivePlayerMoney(killed,-money);
IsInMini[killer] = 0;
SetPlayerVirtualWorld(killer,0);
IsInMini[killed] = 0;
SetPlayerVirtualWorld(killed,0);
}
return 1;
}
And i got those errors:
Код:
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(617) : warning 202: number of arguments does not match definition
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(626) : warning 213: tag mismatch
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(627) : error 035: argument type mismatch (argument 1)
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(628) : error 033: array must be indexed (variable "killer")
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(629) : error 035: argument type mismatch (argument 1)
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(630) : error 033: array must be indexed (variable "killed")
C:\Users\Nikola\Desktop\H\gamemodes\G.pwn(631) : error 035: argument type mismatch (argument 1)
Here is some pictures so you can see what is which line:
Possible or not?
Re: [HELP] GetPlayerMoney [Posible/Not?] -
Mozz - 17.08.2011
https://sampwiki.blast.hk/wiki/GetPlayerMoney
its just
pawn Код:
GetPlayerMoney(playerid);
Re: [HELP] GetPlayerMoney [Posible/Not?] -
MadeMan - 17.08.2011
pawn Код:
new money = GetPlayerMoney(playerid);
Re: [HELP] GetPlayerMoney [Posible/Not?] -
DeadDon - 17.08.2011
Quote:
Originally Posted by MadeMan
pawn Код:
new money = GetPlayerMoney(playerid);
|
Mhm... Could you transform the whole script to me because im a beginner in scripting .
Re: [HELP] GetPlayerMoney [Posible/Not?] -
MadeMan - 17.08.2011
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new killer[24],killed[24];
GetPlayerName(killerid,killer,sizeof(killer));
GetPlayerName(playerid,killed,sizeof(killed));
new money = GetPlayerMoney(playerid);
if(IsInMini[playerid] == 1)
{
new killmsg[129];
format(killmsg,sizeof(killmsg),"{008080} %s je ubio %s dvoboju,",killer,killed);
SendClientMessageToAll(0xFFF000FF,killmsg);
format(killmsg,sizeof(killmsg),"{008080} te uzeo njegovihg {009400} %d {008080}.",money);
SendClientMessageToAll(0xFFF000FF,killmsg);
GivePlayerMoney(killerid,money);
GivePlayerMoney(playerid,-money);
IsInMini[playerid] = 0;
SetPlayerVirtualWorld(playerid,0);
IsInMini[killerid] = 0;
SetPlayerVirtualWorld(killerid,0);
}
return 1;
}
Re: [HELP] GetPlayerMoney [Posible/Not?] -
DeadDon - 17.08.2011
Thank you, you rule!