Sistema de blindgem -
gabrielloko157 - 31.07.2012
Ja tentei de todos os geitos ajuda aew
Ele ta colocando blindagem em todos os carros quando os carros nascem
eu queria que ele ao inves de colocar quando o carro nasce colocar quando um player chegar num determinado local
digitasse /comprarblindagem e comprava ajuda ai olha o FS .
Код:
#include <a_samp>
#include <progress>
enum blind_info
{
Blind,
Bar:BarS,
Text:TDS,
}
new BlindInfo[MAX_VEHICLES][blind_info];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" ReDKiiL Sistema De Blindagem");
print("--------------------------------------\n");
for(new o; o != MAX_VEHICLES; ++o)
{
BlindInfo[o][TDS] = TextDrawCreate(88.000000, 328.000000, "BLINDAGEM:100%");
TextDrawAlignment(BlindInfo[o][TDS], 2);
TextDrawBackgroundColor(BlindInfo[o][TDS], 255);
TextDrawFont(BlindInfo[o][TDS], 1);
TextDrawLetterSize(BlindInfo[o][TDS], 0.220000, 1.000000);
TextDrawColor(BlindInfo[o][TDS], -1);
TextDrawSetOutline(BlindInfo[o][TDS], 1);
TextDrawSetProportional(BlindInfo[o][TDS], 1);
TextDrawUseBox(BlindInfo[o][TDS], 1);
TextDrawBoxColor(BlindInfo[o][TDS], -1);
TextDrawTextSize(BlindInfo[o][TDS], 0.000000, 72.000000);
BlindInfo[o][BarS] = CreateProgressBar(52.00, 319.00, 72.50, 6.19, 0xFFFFFFFF, 100.0);
SetProgressBarValue(BlindInfo[o][BarS],100.00);
BlindInfo[o][Blind] = 100;
}
return 1;
}
public OnFilterScriptExit()
{
for(new o; o != MAX_VEHICLES; ++o)
{
DestroyProgressBar(BlindInfo[o][BarS]);
TextDrawDestroy(BlindInfo[o][TDS]);
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
BlindInfo[vehicleid][Blind] = 100;
SetProgressBarValue(BlindInfo[vehicleid][BarS],100.00);
return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
if(BlindInfo[vehicleid][Blind] != 0)
{
new string[18];
BlindInfo[vehicleid][Blind] --;
RepairVehicle(vehicleid);
format(string,sizeof(string),"BLINDAGEM:%d%%",BlindInfo[vehicleid][Blind]);
TextDrawSetString(BlindInfo[vehicleid][TDS],string);
SetProgressBarValue(BlindInfo[vehicleid][BarS],float(BlindInfo[vehicleid][Blind]));
UpdateProgressBar(BlindInfo[vehicleid][BarS],playerid);
}
return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid,BlindInfo[GetPlayerVehicleID(playerid)][TDS]);
ShowProgressBarForPlayer(playerid,BlindInfo[GetPlayerVehicleID(playerid)][BarS]);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
for(new o; o != MAX_VEHICLES; ++o)
{
TextDrawHideForPlayer(playerid,BlindInfo[o][TDS]);
HideProgressBarForPlayer(playerid,BlindInfo[o][BarS]);
}
}
return 1;
}
Acho que й ali no OnVehicleSpawn
o que eu quero e que quando entra no carro o mostra la blindagem : 0% ai quando o cara blindar o carro ai sim aparece Blindagem 100%
so isso usando o comando /comprarblindagem
ah й e tambem quando ta com esse fs e entra no carro nao aparece mais o meu velocimetro so aparece a o progressbar da blindagem
nao aparece o velocimetro ou vice versa
Meu Velocimetro:
Код:
public VeloThiago()
{
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:Speedo_HP;
for(new i=0; i<MAX_PLAYERS; i++)
{
new vehicle = GetPlayerVehicleID(i);
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
new newcar = GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str1[256],str2[256],str3[256],str4[256],str5[256],str6[256],str7[256];
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, box[i]);
TextDrawShowForPlayer(i, fahrzeug[i]);
TextDrawShowForPlayer(i, mph[i]);
TextDrawShowForPlayer(i, combustivelt[i]);
TextDrawShowForPlayer(i, zustand[i]);
TextDrawShowForPlayer(i, gps[i]);
TextDrawShowForPlayer(i, hoehe[i]);
TextDrawShowForPlayer(i, url[i]);
SpeedoON[i] = 1;
}
format(str1,sizeof(str1),"~w~~d~Veiculo: ~b~~h~~h~%s",vehName[GetVehicleModel(vehicle)-400]);
TextDrawSetString(fahrzeug[i], str1);
format(str2,sizeof(str2),"~w~~d~KM/H: ~y~%d",GetPlayerSpeed(i, true));
TextDrawSetString(mph[i], str2);
format(str3,sizeof(str3),"~w~~d~Combustivel: ~g~~h~%d%%", Gas[vehicle]);
TextDrawSetString(combustivelt[i], str3);
if(IsACopCar(newcar) || IsAExCar(newcar) || IsAnAmbulanceCar(newcar) || IsAPoliciaCivilCar(newcar) || IsAPFCar(newcar) || IsABOPEsCar(newcar) || IsATaxiCar(newcar)|| IsAGOVCar(newcar))
{
format(str4,sizeof(str4),"~w~~d~Blindagem: ~r~~h~Sim");
}
else
{
format(str4,sizeof(str4),"~w~~d~Lataria: ~r~~h~%0.0f%%", Speedo_HP/10);
}
TextDrawSetString(zustand[i], str4);
format(str5,sizeof(str5),"~w~~d~GPS: ~p~~h~%s", ReturnPlayerZone(i));
TextDrawSetString(gps[i], str5);
format(str6,sizeof(str6),"~w~~d~Altura: ~p~~h~%.1f", Speedo_Z);
TextDrawSetString(hoehe[i], str6);
format(str7,sizeof(str7),URLTHIAGO);
TextDrawSetString(url[i], str7);
}
SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box[i]);
TextDrawHideForPlayer(i, fahrzeug[i]);
TextDrawHideForPlayer(i, mph[i]);
TextDrawHideForPlayer(i, combustivelt[i]);
TextDrawHideForPlayer(i, zustand[i]);
TextDrawHideForPlayer(i, gps[i]);
TextDrawHideForPlayer(i, hoehe[i]);
TextDrawHideForPlayer(i, url[i]);
SpeedoON[i] = 0;
}
if(spawnado[i] == 1)
{
if(SpeedoON[i] >= 1)
{
TextDrawHideForPlayer(i, forum[i]);
}
if(SpeedoON[i] <= 0)
{
TextDrawShowForPlayer(i, forum[i]);
}
}
}
}
Respuesta: Sistema de blindgem -
gabrielloko157 - 01.08.2012
Lol Niguem ajuda please helpe-me
Re: Sistema de blindgem -
s4kuL - 01.08.2012
Po vei tenta fazer primeiro pelo menos nй?
Tira tudo do OnVehiclespawn
e ponha esse comando, acho que ira ajudar, (como base).
Ficarб assim:
Comando:
pawn Код:
CMD:comprarblindagem(playerid,params[])
{
BlindInfo[vehicleid][Blind] = 100;
SetProgressBarValue(BlindInfo[vehicleid][BarS],100.00);
SendClientMessage(playerid,-1,"Vocк comprou blidagem!");
return 1;
}
OnVehcleSpawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
return 1;
}
Espero ter ajudado
Re: Sistema de blindgem -
gabrielloko157 - 01.08.2012
ja tirei onvehicle spawn nao mudou nada
Re: Sistema de blindgem -
gabrielloko157 - 02.08.2012
Alguen Ajuda ?