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



GivePlayerMoney - Jokerr_mayne - 28.08.2009

I want to add a command that you can set player cash and that money is save on the userfile saves ( i use dudb include )

Quote:

if(strcmp(cmd, "/setmoney", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "Mayne:/setmoney [playerid/PartOfName] [money]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(playerid != INVALID_PLAYER_ID)
{
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, COLOR_GREEN, "Money has been set");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "you are not authorized to use that command!");
}
}
return 1;
}

This is my command so far dis is my lates trying but now it wont even give money :P

i am stuck on this command like two days..


Re: GivePlayerMoney - NEW_IE - 28.08.2009

Код:
 if(strcmp(cmd, "/setmoney", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_RED, "Mayne:/setmoney [playerid/PartOfName] [money]");
				return 1;
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			  new player;
			  player = ReturnUser(tmp);
			  new money;
			  cash = strval(tmp); // money
			  tmp = strtok(cmdtext, idx);
			  if(IsPlayerConnected(player))
			  {
			    if(player != INVALID_PLAYER_ID)
			    {
			      GivePlayerMoney(player,cash);
						SendClientMessage(player, COLOR_GREEN, "Money has been set");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "you are not authorized to use that command!");
			}
		}
		return 1;
	}
Havnt Tested it but you can try that


Re: GivePlayerMoney - pomogames - 28.08.2009

Confirm if is: GivePlayerMoney or SafeGivePlayerMoney.


Re: GivePlayerMoney - Jokerr_mayne - 28.08.2009

Didnt work i get these errors ?

maby you wanna tell me what this part of the commands means >>>new player; player = ReturnUser(tmp);

Quote:

C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(341) : warning 217: loose indentation
C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(354) : error 017: undefined symbol "ReturnUser"
C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(356) : error 017: undefined symbol "cash"
C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(362) : error 017: undefined symbol "cash"
C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(355) : warning 203: symbol is never used: "money"
C:\Documents and Settings\Administrator\Bureaublad\SAMP\pawno\Mayne RPG.pwn(374) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

Jokerr


Re: GivePlayerMoney - Jokerr_mayne - 29.08.2009

edit i dont use dudb i dont us a Include only a_samp include


Re: GivePlayerMoney - Jokerr_mayne - 29.08.2009

still not fixd anyone got an idee on this ?