GivePlayerMoney
#1

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..
Reply
#2

Код:
 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
Reply
#3

Confirm if is: GivePlayerMoney or SafeGivePlayerMoney.
Reply
#4

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
Reply
#5

edit i dont use dudb i dont us a Include only a_samp include
Reply
#6

still not fixd anyone got an idee on this ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)