dcmd_corrente(playerid, params[])
{
#pragma unused params
if(Player[playerid][pMember] != 14 && Player[playerid][pLeader] != 14 && Player[playerid][pMember] != 1 && Player[playerid][pLeader] != 1 && Player[playerid][pMember] != 21 && Player[playerid][pLeader] != 21 && Player[playerid][pMember] != 2 && Player[playerid][pLeader] != 2)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo й um um COP.");
else if(Player[playerid][pCorrente] != -1)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк sу pode colocar uma corrente por vez, use /rcorrente para retirar a outra.");
else if(GetPlayerInterior(playerid) != 0)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo pode colocar correntes aqui.");
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
Player[playerid][pCorrente] = 1;
format(thestring, sizeof(thestring), "Corrente colocada por %s. Coordenadas : X = %f Y = %f Z = %f ",ReturnPlayer(playerid), X, Y, Z);
WriteLog("Admins2", thestring);
format(thestring, sizeof(thestring), "HQ: Uma corrente foi colocada por %s.", Player[playerid][pName]);
for(new i = 0; i <= HighestID; i++)
if(IsPlayerConnected(i))
if(Player[i][pMember] == TEAM_PM || Player[i][pLeader] == TEAM_PM || Player[i][pMember] == TEAM_MUNICIPAL || Player[i][pLeader] == TEAM_MUNICIPAL)
SendClientMessage(i, COLOR_PM, thestring);
for(new i=0; i<10; i++)
{
if(corrente[i] == 0)
{
corrente[i] = 1;
correnteobj[i] = CreateDynamicObject(2899, X, Y, Z-0.9, 0, 0, A-90);
Player[playerid][pCorrente] = i;
return 1;
}
if(i == 9)
return SendClientMessage(playerid, COLOR_RED, "O limite de barreiras foi atingido.");
}
return 1;
}
So o objeto nгo fura o pneu
achei esse sistema talvez possa funcionar ! http://www.4shared.com/file/t8mixDVm..._Pregos_2.html |
#define FILTERSCRIPT
#include <a_samp>
#define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3)
new
Tapete,
Float:xx,
Float:yy,
Float:zz;
forward
PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward
Pneu(playerid);
public
PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid)) {
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
// printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) {
return 1;
}
}
return 0;
}
public
OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Tapede Load By: [FeK]Higor");
print("--------------------------------------\n");
SetTimer("Pneu",199,1);
return 1;
}
public
Pneu(playerid)
{
new Dano[4];
if (IsPlayerInAnyVehicle(playerid)) {
if (PlayerToPoint(5.0, playerid,xx,yy,zz)) {
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1));
GameTextForPlayer(playerid,"~w~Pneu Furado :)",6000,1);
}
}
}
public
OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/criartapete", cmdtext, true, 10) == 0) {
GetPlayerPos(playerid,xx,yy,zz);
Tapete = CreateObject(2899, xx, yy, zz, 0, 0,0);
GameTextForPlayer(playerid,"~w~Tapede criado :)",6000,1);
return 1;
}
if (strcmp("/deletartapete", cmdtext, true, 10) == 0) {
DestroyObject(Tapete);
GameTextForPlayer(playerid,"~w~Tapede Deletado",6000,1);
return 1;
}
return 0;
}
pawn Код:
|