Jump to content
  • 0

Ajutor pickup /enter


Otiy

Question

4 answers to this question

Recommended Posts

http://wiki.sa-mp.com/wiki/AddStaticPickup - creezi Pickupul

Creezi o comanda enter si verifici daca e injurul pickupului: http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint ( pui coordonatele pickupului aici ) si dupa asta pui ce vrei sa faca.

- Exemplu:

La OnGameModeInit:

[pawn]AddStaticPickup(1239, 0.0, 0.0, 5.0);[/pawn]

Comanda "/enter":

[pawn]if(strcmp(cmdtext, "/enter", true) == 0)

{

//aici verifici daca e in jurul pickupului:

if( IsPlayerInRangeOfPoint(playerid, 3.0, 0.0, 0.0, 5.0) ) //0.0, 0.0, 5.0 - coordonatele, 3.0 - la ce distanta de pickup poate sa fie cand scrie /enter

{

//aici scrii ce sa faca, exemplu:

SetPlayerPos(playerid, 100.0, 100.0, 500.0); //seteaza pozitia

SetPlayerInterior(playerid, 1); //seteaza interiorul

}

return 1;

}[/pawn]

Link to comment
Share on other sites

[pawn]if(strcmp(cmdtext, "/exit", true) == 0)

{

//aici verifici daca e in jurul pickupului:

if( IsPlayerInRangeOfPoint(playerid, 3.0, 0.0, 0.0, 5.0) ) //0.0, 0.0, 5.0 - coordonatele din interior, 3.0 - la ce distanta de pickup poate sa fie cand scrie /exit

{

//aici scrii ce sa faca, exemplu:

SetPlayerPos(playerid, 100.0, 100.0, 500.0); //seteaza pozitia de afara

SetPlayerInterior(playerid, 1); //seteaza interiorul

}

return 1;

}[/pawn]

Asa de greu e=))

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.