Jump to content

[REZOLVAT] Intrebare sistem farm.


iShow
 Share

Recommended Posts

Salut, am facut ceva dar nu este bine.
Vreau ca dupa ce se termina cursa de farm sa spawneze un bobcat, nedestructibil si sa urce respectivul player la volan.
Daca se da jos masina sa dispara, nu respawn, destroy.
Multumesc.

Link to comment
Share on other sites

  • Retired

 

new bobcatvehicle[MAX_PLAYERS]; 
CMD:bobcat(playerid) {
new Float:x, Float:y,Float:z; 
GetPlayerPos(playerid,x,y,z); 
bobcatvehicle[playerid] = CreateVehicle(422,x,y,z,90.0000,-1,-1,100); 
SetVehicleHealth(bobcatvehicle[playerid],10000000.0); 
PutPlayerInVehicle(playerid,bobcatvehicle[playerid],0); 
return 1; 
}
public OnPlayerExitVehicle(playerid, vehicleid) {
if(vehicleid == bobcatvehicle[playerid]) DestroyVehicle(bobcatvehicle[playerid]),SCM(playerid,-1,"Vehicul distrus."); 
return 1;
}
/*
-> EXPLICATIE
 
Am creeat o variabila care sa reprezinte masina, aceasta fiind bobcatvehicle, folosindu-ma de functia CreateVehicle.
Se creeaza vehiculul la coordonatele x,y,z, accestea fiind ale jucatorului care acceseaza comanda, folosindu-ma de GetPlayerPos si de niste variabile de tip Float. 
Se seteaza "viata" vehiculului, sa fie infinita cum ai zis tu prin functia SetVehicleHealth. 
Jucatorul ajunge la volan cu ajutorul functie PutPlayerInVehicle. 
Se verifica la onplayerexitvehicle daca vehiculul este bobcatvehicle(cel creat) sa fie distrus. 
*/

 

Iti updatezi tu codu' asta pentru jobul tau, cred ca te duce capu macar atat sa faci :D 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...