[Ajuda] Ajuda /cadeia
#1

Tipo como fзo para colocar o /cadeia para Almentar a cadeia da pessoa. Exemplo. Estou preso por 10 minutos. ai o admin da /cadeia Praquenome 30. ai a cadeia fica 30 no caso eu quero colocar para fazer 30+10=40 no caso ficando 40 minutos na cadeia. Me ajudem

Код HTML:
	if(strcmp(cmd, "/cadeia",true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new tempo[20];
	        new tempo2;
	        if(PlayerInfo[playerid][pAdmin] < 3)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo esta autorizado para usar este comando!");
	            return true;
	        }
	        tmp = strtok(cmdtext, idx);
	        tempo = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo] [Motivo]");
				return true;
			}
			if(!strlen(tempo))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo] [Motivo]");
				return true;
			}
            if(admtrampando[playerid] < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
				return true;
			}
			giveplayerid = ReturnUser(tmp);
			tempo2 = strval(tempo);
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
			idx++;
			}
			new offset = idx;
			new result[100];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
			result[idx - offset] = cmdtext[idx];
			idx++;
			}
			result[idx - offset] = EOS;
		    if(IsPlayerConnected(giveplayerid))
		    {
		        if(giveplayerid != INVALID_PLAYER_ID)
		        {
   		         	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Admin %s colocou %s na Cadeia, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
					SendClientMessageToAll(COLOR_LIGHTRED, string);
					ResetPlayerWeaponsEx(giveplayerid);
					OnPlayerUpdate(giveplayerid);
					PlayerInfo[giveplayerid][pJailed] = 6;
					PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
					SetPlayerInterior(giveplayerid, 5);
					SetPlayerPos(giveplayerid, 318.5804,316.9043,999.1484);
			 	}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   O jogador estб offline !");
			    return true;
			}
	    }
	    return true;
	}
Reply
#2

Na linha

pawn Код:
PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
coloque

pawn Код:
PlayerInfo[giveplayerid][pJailTime] += tempo2 * 60;
Coloque um + antes do =, ai ficara uma adiзгo
Reply
#3

ae man me ajudou. й tao simples e eu se matando aki
Reply
#4

Quote:
Originally Posted by PraqueNome
Посмотреть сообщение
ae man me ajudou. й tao simples e eu se matando aki
mas se vc fazer isso, vc nao conseguira tirar o cara da cadeia com o comando /cadeia,

pois se vc digitar "/cadeia [ID] [Tempo = 0] [Motivo]" nao vai tirar o cara da cadeia. Nao iria setar o

PlayerInfo[giveplayerid][pJailTime] pra 0
Reply
#5

Sim eu tenho o /setcadeia para setar e /cadeia. msmo assim eu coloca /cadeia id -(menos)(numerocadeia) e o mesmo saira. mais vlw ae
Reply
#6

Quote:
Originally Posted by PraqueNome
Посмотреть сообщение
Sim eu tenho o /setcadeia para setar e /cadeia. msmo assim eu coloca /cadeia id -(menos)(numerocadeia) e o mesmo saira. mais vlw ae
a tendi =D
de boa, qualquer coisa, tamo ai
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)