arrumei o fs pra vc, faltava dois new sendername[24]; duas cores e a funзгo proxdetector.
pawn Код:
//••••••••••••••••••••••••••••••••••••••••••••••••••••
//••
#include <a_samp>
#define MEUS_SLOTS 20
//************ Cores **************************
#define AMARELO 0xFFFF00AA
#define VERDE 0x33AA33A
#define COLOR_RED 0xAA3333AA
#define RED 0xAA3333AA
#define COLOR_PURPLE 0x990099AA
//********** Arrays ***************************
new CintoPlayer[MEUS_SLOTS];
//***************** 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/70);
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,"");
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;
SendClientMessage(playerid,COLOR_RED,"Vocк estб sem cinto.");
return 1;
}
//******** Call Backs Comandos *******************************
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/cinto", true))
{
new sendername[24];
new string[256];
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"Vocк meteu o cinto de seguranзa, agora estб protegido dos acidentes.");
format(string, sizeof(string), "* %s mete o cinto de seguranзa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
new sendername[24];
new string[256];
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,RED,"Vocк tirou o cinto de seguranзa, cuidado com a policia.");
format(string, sizeof(string), "* %s tira o cinto de seguranзa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
return 0;
}
forward ProxDetector(Float:radi, playerid, str[], col1, col2, col3, col4, col5);
public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, str);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, str);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, str);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, str);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, str);
}
}
}
}//not connected
return 1;
}
//the end