Jump to content
  • 0

checkpoint random pe comanda


johnytest

Question

 

 

Salut, vreau ca atunci cand folosesc comanda ex: /comanda sa imi dea un checkpoint random din 10 sa spun asa, dar pe harta nu imi apare nici unul din locatiile salvate, imi apare unul care nu il folosesc, sus in LS la acea ferma daca stiti.

 

new Float:cprandom[5][4] = 
{
{1098.6758,-1789.2413,13.6129,5.0},
{1363.7327,-1741.4376,13.5469,5.0},
{1207.5503,-1701.5598,13.5517,5.0},
{1146.3723,-1737.9576,13.5141,5.0},
{1083.8269,-1838.0867,13.5693,5.0}
};
if(IsPlayerInRangeOfPoint(playerid,5.0,cprandom[randcp][0],cprandom[randcp][1],cprandom[randcp][2]))

Cam asa ar arata, tin sa anunt ca nu mai am alt checkpoint in comanda, nu vreau sa dau toata comanda ca incerc sa fac ceva de capul mai, am vazut in diverse topicuri ca s a postat mai mult si altii au inceput sa copieze... deci, totusi daca mai e nevoie de altceva pot arata.

Checkpointurile de mai sus sunt adaugate pe la inceputul GM-ului iar al 2-lea cod este adaugat in comanda.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
25 minutes ago, johnytest said:

 


if(IsPlayerInRangeOfPoint(playerid,5.0,cprandom[randcp][0],cprandom[randcp][1],cprandom[randcp][2]))

 

In  codul de mai sus nu faci decat sa verifici daca te afli la una din coordonatele tale scrise mai sus mai exact la valoarea variabilei randcp.

Tu ai spus ca vrei sa iti puna un checkpoint random din cele definite folosind o comanda, adica asa:

CMD:comanda(playerid,params[])

{
	new randcp = random(sizeof(cprandom));
    SetPlayerCheckpoint(playerid, cprandom[randcp][0], cprandom[randcp][1], cprandom[randcp][2], cprandom[randcp][3]);
	return 1;
}

 

  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.