06.11.2010, 18:21
eu tenho um comando que so pode usa em carro mas ele ta configurado para todos os automoveis e tambem quando ta a pй da pra usa o comando
#include <a_samp>
#include <core>
#include <float>
new glob0[20];
public OnVehicleDamageStatusUpdate(arg0, playerid)
{
if(!glob0[playerid])
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, Float:var3 = 0.0, Float:var4 = 0.0;
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerFacingAngle(playerid, var3);
GetVehicleHealth(arg0, var4);
SetPlayerHealth(playerid, var4 / 10);
SetPlayerPos(playerid, var0 + 2, var1 + 2, var2 + 1);
RemovePlayerFromVehicle(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SendClientMessage(playerid, 0xFFFF00AA, "[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer");
SetTimer("ANIM", 5000, false);
SetPlayerWantedLevel(playerid, 1);
}
return 1;
}
public ANIM(playerid)
{
ClearAnimations(playerid);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
glob0[playerid] = 0;
GameTextForPlayer(playerid, "~r~/cinto Caso Contrario ~n~Morrer em Batidas", 3000, 4);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext)
{
if(!strcmp(cmdtext, "/cinto", true))
{
glob0[playerid] = 1;
SendClientMessage(playerid, 0x033AA33A, "[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
glob0[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00AA, "[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
return 0;
}
#include <a_samp>
#include <core>
#include <float>
new glob0[20];
public OnVehicleDamageStatusUpdate(arg0, playerid)
{
if(!glob0[playerid])
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, Float:var3 = 0.0, Float:var4 = 0.0;
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerFacingAngle(playerid, var3);
GetVehicleHealth(arg0, var4);
SetPlayerHealth(playerid, var4 / 10);
SetPlayerPos(playerid, var0 + 2, var1 + 2, var2 + 1);
RemovePlayerFromVehicle(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SendClientMessage(playerid, 0xFFFF00AA, "[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer");
SetTimer("ANIM", 5000, false);
SetPlayerWantedLevel(playerid, 1);
}
return 1;
}
public ANIM(playerid)
{
ClearAnimations(playerid);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
glob0[playerid] = 0;
GameTextForPlayer(playerid, "~r~/cinto Caso Contrario ~n~Morrer em Batidas", 3000, 4);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext)
{
if(!strcmp(cmdtext, "/cinto", true))
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x033AA33A," Vocк nгo esta em um veiculo!");
glob0[playerid] = 1;
SendClientMessage(playerid, 0x033AA33A, "[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x033AA33A," Vocк nгo esta em um veiculo!");
glob0[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00AA, "[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
return 0;
}