mimicami Posted January 27, 2014 Posted January 27, 2014 Salut! Am o mica problema:cand spawnez o masina, si dau respawn nu imi dispare si imi apare unde am spawnat-o. Daca ma poate ajuta cineva sa o fac sa dispara. Aceasta este comanda de respawn. Multumesc!CMD:vrespawn(playerid, params[]){ new sec,string[128]; if(sscanf(params,"i",sec)) return SendClientMessage(playerid, COLOR_RED, "USAGE:/vrespawn [seconds]"); SetTimer("vrespawn", sec*1000, false); format(string, sizeof(string), "~All currently unoccupied vehicles will respawn in %d seconds.",sec); SendClientMessageToAll(COLOR_ORANGE, string); return 1;}forward vrespawn();public vrespawn(){ new u[MAX_VEHICLES]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInAnyVehicle(i)) u[GetPlayerVehicleID(i)]=1; } for(new i;i<MAX_VEHICLES;i++) { if(u != 1) SetVehicleToRespawn(i); else continue; } SendClientMessageToAll(COLOR_ORANGE, "~All vehicles have been respawned."); return 1;}
mimicami Posted January 27, 2014 Author Posted January 27, 2014 pai nu o sa dau mereu restart la srv..
Iulian Posted January 28, 2014 Posted January 28, 2014 Atunci foloseste http://wiki.sa-mp.com/wiki/DestroyVehicle.Nu am sa te ajut cu tot sistemul, sa ti-l fac de la 0. Postezi ce ai incercat si am sa te ajut unde nu te descurci. Rate me
Question
mimicami
Salut! Am o mica problema:cand spawnez o masina, si dau respawn nu imi dispare si imi apare unde am spawnat-o. Daca ma poate ajuta cineva sa o fac sa dispara. Aceasta este comanda de respawn. Multumesc!
CMD:vrespawn(playerid, params[])
{
new sec,string[128];
if(sscanf(params,"i",sec)) return SendClientMessage(playerid, COLOR_RED, "USAGE:/vrespawn [seconds]");
SetTimer("vrespawn", sec*1000, false);
format(string, sizeof(string), "~All currently unoccupied vehicles will respawn in %d seconds.",sec);
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}
forward vrespawn();
public vrespawn()
{
new u[MAX_VEHICLES];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i)) u[GetPlayerVehicleID(i)]=1;
}
for(new i;i<MAX_VEHICLES;i++)
{
if(u != 1) SetVehicleToRespawn(i); else continue;
}
SendClientMessageToAll(COLOR_ORANGE, "~All vehicles have been respawned.");
return 1;
}
3 answers to this question
Recommended Posts