/pay Help please :)
#1

Hi everyone i got this /pay system here i cant get working i cant see the problem -_-'

Code:
{
	new string[256];
	new playermoney;
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new cmd[256];
  new tmp[256], tmp2[256];
	new giveplayerid;
	new idx, moneys;
	GetPlayerName(playerid, playername, sizeof(playername));
	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/pay", true) == 0) {
	  if(!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /pay [Playerid] [Amount]!");
			return 1;
		}
		giveplayerid = strval(tmp);
		
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) {
		  SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /pay [Playerid] [Amount]!");
		  return 1;
		}
		moneys = strval(tmp);
		
		  if(IsPlayerConnected(giveplayerid)) {
		    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
	  	  GetPlayerName(playerid, sendername, sizeof(sendername));
	    	playermoney = GetPlayerMoney(playerid);
		    if (moneys > 0 && playermoney >= moneys) {
		      GivePlayerMoney(playerid, (0 - moneys));
	  	    GivePlayerMoney(giverplayerid, moneys);
					format(string, sizeof(string), "You Have Given $%d To %s(%d)!", moneys, giveplayer, giveplayerid);
					SendClientMessage(playerid, COLOR_GREEN, string);
					format(string, sizeof(string), "You Recieved $%d From %s(%d)!", moneys, sendername, playerid);
					SendClientMessage(giveplayerid, COLOR_GREEN, string);
					printf("%s(%d) Has Given $%d To %s(%d)", sendername, playerid, moneys, giveplayer, giveplayerid);
				{
		    else
		    }
				  SendClientMessage(playerid, COLOR_RED, "You Dont Have That Amount Of Money!"
			}
			else
			{
			  format(string, sizeof(string), "%d Is Not And Active Player!", giveplayerid);
		  	SendClientMessage(playerid, COLOR_RED, string);
			}
			return 1;
		}
}
i get these error's ..

Code:
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(501) : warning 217: loose indentation
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(507) : error 017: undefined symbol "giverplayerid"
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(513) : warning 217: loose indentation
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(514) : error 029: invalid expression, assumed zero
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(516) : warning 217: loose indentation
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(516 -- 517) : error 001: expected token: ",", but found "}"
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(518) : warning 217: loose indentation
C:\Users\------\Desktop\Server ting\SERVER\gamemodes\CS-RP.pwn(523) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply


Messages In This Thread
/pay Help please :) - by Xyphozal - 20.05.2010, 20:47
Re: /pay Help please :) - by pmk1 - 20.05.2010, 21:09
Re: /pay Help please :) - by Almighty Socrates - 20.05.2010, 23:05
Re: /pay Help please :) - by pmk1 - 20.05.2010, 23:17
Re: /pay Help please :) - by Xyphozal - 21.05.2010, 02:35
Re: /pay Help please :) - by pmk1 - 21.05.2010, 14:45
Re: /pay Help please :) - by Xyphozal - 21.05.2010, 18:09
Re: /pay Help please :) - by Almighty Socrates - 22.05.2010, 07:38
Re: /pay Help please :) - by pmk1 - 22.05.2010, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)