pawn Код:
//•••••••••••••••••••••••••••••••••••••••••••••••••• ••
//••
#include <a_samp>
#define MEUS_SLOTS 20
//************ Cores **************************
#define AMARELO 0xFFFF00AA
#define VERDE 0x33AA33A
//********** Arrays ***************************
new CintoPlayer[MEUS_SLOTS];
//********** Definir Public *********************
forward OnVehicleDamageStatusUpdate(vehicleid, playerid);
//***************** CallBakcs (Detectar Batida *****************
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
if(CintoPlayer[playerid] == 0)
{
new Float:Px = 0.000000, Float:Py = 0.000000, Float:Pz = 0.000000, Float:Pa = 0.000000, Float:HV ;
GetPlayerPos(playerid, Px, Py, Pz);//PEGA POS
GetPlayerFacingAngle(playerid, Pa);//PEGA ANGULO
GetVehicleHealth(vehicleid,HV);
SetPlayerHealth(playerid,HV/10);
SetPlayerPos(playerid,Px+2,Py+2,Pz+1);
RemovePlayerFromVehicle(playerid);//REMOVE VEICULO
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer");
SetTimer("ANIM",5000,0);
SetPlayerWantedLevel(playerid, 1);
}
return 1;
}
//************ CallBacks Para Anims **************************
forward ANIM(playerid);
public ANIM(playerid)
{
ClearAnimations(playerid);
return 1;
}
//*************** Call Backs Entra Veiculos ******************
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
CintoPlayer[playerid] = 0;
GameTextForPlayer(playerid, "~r~/cinto ~w~ Caso Contrario ~n~Morrer em Batidas", 3000, 4);
return 1;
}
//**************** Nгo Deixar Sair do Carro **********************
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(CintoPlayer[playerid]==1)
{
SendClientMessage(playerid,0x00FF00AA,"Vocк Esta de Cinto,Tire-O");
PutPlayerInVehicle(playerid, vehicleid, 0);
}
return 1;
}
//******** Call Backs Comandos *******************************
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/cinto", true))
{
if(CintoPlayer[playerid]==1) return SendClientMessage(playerid,0x00FF00AA,"Vocк ja esta de Cinto");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
if(CintoPlayer[playerid]==0) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta de Cinto");
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
return 0;
}
//*************** The End *************************************