02.11.2011, 21:41
Galera eu queria um codigo nгo comando pra quando o cara mata ja nascer na cadeia da DP!
#include <a_samp>
new AntiDM[MAX_PLAYERS];
#define VERDE 0x33AA33AA
#define Vermelho 0xF60000AA
public OnPlayerUpdate(playerid){
if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN || GetPlayerWeapon(playerid) == 8 || GetPlayerWeapon(playerid) == 42 || GetPlayerWeapon(playerid) == 40 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37 || GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 39 || GetPlayerWeapon(playerid) == 44 ||
GetPlayerWeapon(playerid) == 37 || GetPlayerWeapon(playerid) == 34 || GetPlayerWeapon(playerid) == 33 || GetPlayerWeapon(playerid) == 32 || GetPlayerWeapon(playerid) == 31 || GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 29 || GetPlayerWeapon(playerid) == 28 || GetPlayerWeapon(playerid) == 27 || GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 25 || GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 23 ||
GetPlayerWeapon(playerid) == 22 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 17 || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 15)
{if(!IsPlayerAdmin(playerid)){
SendClientMessage(playerid, Vermelho, "(SERVER): Vocк foi preso por pegar ARMAS!");
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,197.6661,173.8179,1003.0234);
SetPlayerInterior(playerid,3);
AntiDM[playerid] = 1;
SetTimerEx("SoltarJogador", 100000, 0, "i", playerid);
}}return 1;}
forward SoltarJogador(playerid);
public SoltarJogador(playerid){
if( IsPlayerConnected(playerid) == 1) {
SetPlayerHealth(playerid,0.0);
AntiDM[playerid] = 0;
SendClientMessage(playerid,VERDE,",INFO: Vocк foi solto! Nгo pegue mais armas no servidor.");}
return 1;}
public OnPlayerText(playerid, text[]){
if(AntiDM[playerid] == 1){
SendClientMessage(playerid,Vermelho,",INFO: Vocк nгo pode falar em quanto tiver PRESO!");}
return 1;}
public OnPlayerCommandText(playerid, cmdtext[]){
if(AntiDM[playerid] == 1 && strcmp(cmdtext,"/", true) != 0) return SendClientMessage(playerid,Vermelho,"(ERRO): Vocк nгo pode digitar quando estiver PRESO!");return 0;}
public OnPlayerDeath(playerid, killerid, reason)
{
SendClientMessage(killerid,-1,"Vocк cometeu DM e foi altomaticamente preso¬¬");
SetPlayerPos(killerid,x,y,z);//pos cadeia
SetPlayerInterior(killerid,Numero);//int cadeia
ResetPlayerWeapons(killerid);
SetTimerEx("sair", TEMPO, false, "i", killerid);//tempo em milisegundos
return true;
}
forward sair(killerid);
public sair(killerid)
{
SendClientMessage(killerid,-1,"Vocк saiu da cadeia, nгo faзa mais DM¬¬");
SpawnPlayer(killerid);
return true;
}
#include <Dini>
new Preso[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("CheckCadeia", 1000, true);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Preso[killerid] = TEMPO // tempo em milisegundos
SendClientMessage(killerid,-1,"Vocк cometeu DM e foi altomaticamente preso ¬¬");
SetPlayerPos(killerid,x,y,z);//pos cadeia
SetPlayerInterior(killerid,Numero);//int cadeia
ResetPlayerWeapons(killerid);
return true;
}
forward CheckCadeia();
public CheckCadeia()
{
for(new i, p = GetMaxPlayers(); i < p; i ++)
{
if(!IsPlayerConnected(i) || !Preso[i]) continue;
Preso[i]--;
if(!Preso[i])
{
SendClientMessage(killerid,-1,"Vocк saiu da cadeia, nгo faзa mais DM¬¬");
SpawnPlayer(killerid);
}
}
return true;
}
public OnPlayerSpawn(playerid)
{
if(Preso[playerid])
{
SendClientMessage(playerid,-1,"Sua pena ainda nгo acabou !");
SetPlayerPos(playerid,x,y,z);//pos cadeia
SetPlayerInterior(playerid,Numero);//int cadeia
ResetPlayerWeapons(killerid);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(!fexist("Presos.txt")) dini_Create("Presos.txt");
new n[24];
GetPlayerName(playerid, n, 24);
dini_IntSet("Presos.txt", n, Preso[playerid]);
return 1;
}
public OnPlayerConnect(playerid)
{
new n[24];
GetPlayerName(playerid, n, 24);
Preso[playerid] = dini_Int("Presos.txt", n);
return 1;
}