SA-MP Forums Archive
BUG /moneyall - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: BUG /moneyall (/showthread.php?tid=407525)



BUG /moneyall - Virusatu - 14.01.2013

Salut , deci dau moneyall si suma le da banii apoi le ia ,,,



Code:
	   if(strcmp(cmd, "/moneyforall", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdminServer] >= 7)
		{
			SendClientMessage(playerid, COLOR_DBLUE, "Correct {B8DBFF}Synthax: /moenyforall <Amount>");
			return 1;
		}
	    new money;
		money = strval(tmp);

	    if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdminServer] >= 7)
			{
			    if ( money >= 99999999)
			    {
			    SendClientMessage(playerid, COLOR_RED, "ERROR : Too much moneys!");
			    } else if ( money < 99999999)
			    {
			    format(string, 256, "All players recieved $%s from %s" ,tmp,sendername);
				BroadCast(COLOR_LIGHTRED,string);
				for(new i=0; i < MAX_PLAYERS; i++)
			    {
				GivePlayerMoney(i, money);
				}
				}
			}
			else
			{
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}