All pastes #909119 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-18 22:47 UTC
rendered paste body
forward Travar(playerid);

new Trava[MAX_PLAYERS];

-----------------------------------------------

	if(strcmp(cmd, "/multar", true) == 0) {
	    if(Profissao[playerid] == COP_CIVIL || Profissao[playerid] == POLICIA_FLORESTAL || Profissao[playerid] == IBAMA || Profissao[playerid] == EXERCITO || Profissao[playerid] == COP_FEDERAL || Profissao[playerid] == ELITE || Profissao[playerid] == FBI || IsPlayerAdmin(playerid)){
			new tmp[256];
	    	new plid;
	    	new quant;
	    	new string[256];
	    	SetTimerEx("TravarTrava", 60000, 0, "d", playerid);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) {
				SendClientMessage(playerid, COLOR_RED, "/multar [id] [quantidade]");
				return 1;
			}
        	plid = strval(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) {
				SendClientMessage(playerid, COLOR_RED, "/multar [id] [quantidade]");
				return 1;
			}
        	quant = strval(tmp);
 			if(quant > 1000 || quant <= 0){
				SendClientMessage(playerid, COLOR_RED, "Você não está querendo multar de forma justa.");
				return 1;
			}
			if(IsPlayerConnected(plid)){
				format(string, sizeof(string), "Você recebeu uma multa de %d dada por %s . O dinheiro foi retirado do banco.", quant, PlayerName(playerid));
				SendClientMessage(plid, COLOR_GREEN, string);
				SendClientMessage(playerid, COLOR_GREEN, "Multa dada.");
				udb_setBankMoney(PlayerName(plid), udb_getBankMoney(PlayerName(plid)) - quant);
				return 1;
			}
			else{
			    SendClientMessage(playerid, COLOR_RED, "O jogador não está conectado!");
				return 1;
			}
		}
		if(Profissao[playerid] != COP_CIVIL || Profissao[playerid] != COP_FEDERAL || Profissao[playerid] != ELITE){
			SendClientMessage(playerid, COLOR_RED, "Você não é policial");
			return 1;
		}
	}

-----------------------------------------------------

public Travar(playerid){
Trava[playerid] = 0;
}