Jump to content

Va rog ajutatima!!


Nica_Mihai

Recommended Posts

Cum pot face o comanda sa ma teleporteze la la coordonata setata la alta coordonata dar sa pot da sa ma teleporte doar daca sunt langa coordonata de unde am pus sa ma teleporteze ,

cum e si la /exam dar sa ma dea doar pe mine fara masina .

Va rog spunetimi cum sa fac ! Pentru ca asa o sa invat si eu usor usor!

Link to comment
Share on other sites

Sunt pe tell.. 

CMD:cmd(playerid, params[]) {
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))          SendClientMessage(playerid,0xFFFFFFFF,"textttt" ); SetPlayerPos(playerid, x, y, z);              }    
return 1;
Edited by Erik.

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

Link to comment
Share on other sites

  • 3 weeks later...

Salut!

(Q)Cum pot să construiesc o comandă sa ma teleporteze la coordonatele X Y Z, doar daca eu sunt in coordonatele X1 Y1 Z1?

(A)Construim comanda /exam2(exemplu pe care il vom folosi și la a doua problemă)

Depinde de procesorul de comenzi pe care il folosești vei folosi ori CMD:exam2..... ori YCMD:exam2, etc...

Va arăta ceva in acest gen:

CMD:exam2(playerid, params[])
{
	return 1;
}

In interiorul comenzii voi adăuga o funcție numită IsPlayerRangeOfPoint care are următorii parametrii:

IsPlayerInRangeOfPoint(playerid, raza, X.X, Y.Y, Z.Z)

Vom seta o rază pe care vrem să acționeze comanda, un exemplu de rază e 5, pentru că va acționa pe raza de 5m.

Inainte de a seta coordonatele X Y respectiv Z, te rog sa intrii in joc si să scrii unde vrei tu /save punctul meu spre exemplu, dupa care mergi in Documents>> GTA San Andreas User Filles >> SA-MP si ai acolo un fișier savedposition.txt, il deschizi si ai coordonatele X Y Z Angle si restul..

Exemplu:                             X                      Y              Z

AddPlayerClass(271,-2107.1741,1085.8170,55.7274,82.6958,0,0,0,0,0,0); // pspos 99

Coordonata X.X - In acest caz va fi -2107.1741

Coordonata Y.Y - 1085.8170

Coordonta Z.Z - 55.7274

Ok, am pus restrictia ca X să se afle in raza unui punct, acum punem ca acest player sa se teleporteze intr-un punct unde vrem noi, pentru asta voi folosi SetPlayerPos, si eventual un mesaj prin care e anuntat ca e teleportat...

O schiță va arăta așa:

CMD:exam2(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 5, X.X, Y.Y, Z.Z))//
		{
			SetPlayerPos(playerid, X1.X, Y1.Y, Z1.Z);
			SendClientMessage(playerid, -1, "Ai fost teleportat la coordonatele cerute.");
		}
		else 
		{
			SendClientMessage(playerid, -1, "Nu esti in raza unde poti da /exam2, ti-a fost amplasat un checkpoint, te rog sa il urmezi.");
			SetPlayerCheckpoint(playerid, XX.X, YY.Y, ZZ.Z, RAZACP);
		}
	return 1;
}

Adică pe scurt comanda va executa astfel:

Dacă X este in raza Y atunci va fi teleportat in zona Z.

Daca X nu este in raza Y atunci el va primi un mesaj si un checkpoint pentru a merge in zona Z.

Sper că te-am ajutat, spor si multă baftă!

 

 

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
Reply to this topic...

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