/fine not working
#10

HTML Code:
if(strcmp(cmd, "/fine", true) == 0)
	{
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 3)
            {
            	SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
				return 1;
			}
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
				return 1;
			}
			moneys = strvalEx(tmp);
			if(moneys < 1) { SendClientMessage(playerid, COLOR_GREY, "   Fine Money can't be below 1 !"); return 1; }
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
					{
						result[idx - offset] = cmdtext[idx];
						idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
						return 1;
					}
					if(UseAdmCmdTimer[playerid] > 3)
					{
					    new IP[16];
					    new year, month, day;
						getdate(year, month, day);
						GetPlayerName(playerid, sendername, sizeof(sendername));
   						GetPlayerIp(playerid, IP, sizeof(IP));
						format(string, sizeof(string), "%s [%d/%d/%d] Name: %s Key: %s Reason: Spam.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
	    				BanLog(string);
	    				format(string, sizeof(string), "AdmCmd: %s was banned by You_Got_Owned, reason: Spam.", sendername);
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						PlayerInfo[playerid][pBand] = 3;
						PlayerInfo[playerid][pPermBand] = 1;
			    		BanEx(playerid, "Banned By: Autoban Reason: Spam");
			    		
			    		return 1;
					}
					PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]-moneys;
					GivePlayerMoney(giveplayerid,-moneys);
					format(string, sizeof(string), "AdmCmd: %s has been fined $%d by an Admin, reason: %s", giveplayer, moneys, (result));
					SendClientMessageToAll(COLOR_LIGHTRED, string);
					UseAdmCmdTimer[playerid]++;
					SetTimerEx("UseAdmCmd",3*1000,0,"i",playerid); //3 seconds
			    }
			}
            else
			{
  				SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
  				return 1;
			}
        }
        return 1;
	}
Reply


Messages In This Thread
/fine not working - by $$Money$$ - 28.12.2011, 07:02
Re: /fine not working - by Jochemd - 28.12.2011, 08:31
Re: /fine not working - by $$Money$$ - 28.12.2011, 08:36
Re: /fine not working - by SupremeCommander - 28.12.2011, 08:37
Re: /fine not working - by Jochemd - 28.12.2011, 08:56
Re: /fine not working - by Max_Coldheart - 28.12.2011, 09:03
Re: /fine not working - by Chris White - 28.12.2011, 09:05
Re: /fine not working - by Jochemd - 28.12.2011, 09:06
Re: /fine not working - by hittt - 28.12.2011, 11:26
Re: /fine not working - by Leo_Johnson - 28.12.2011, 11:28
Re: /fine not working - by Jochemd - 28.12.2011, 21:22
Re: /fine not working - by Steven82 - 28.12.2011, 21:28
Re: /fine not working - by Jochemd - 28.12.2011, 21:51
Re: /fine not working - by [ABK]Antonio - 28.12.2011, 22:08

Forum Jump:


Users browsing this thread: 4 Guest(s)