PDA

View Full Version : [Tutorial]Teleport Command + Create Object



Royce.
31-03-2017, 09:34 PM
Cum cream o commanda de telportare ?

public OnPlayerCommandText(playerid, cmdtext[])

Si commanda trebuie sa arata cam asa :

if(strcmp(cmdtext, "/ultracs_goto", true)==0)
{
SetPlayerPos(playerid, XX,YY,ZZ);
GameTextForPlayer(playerid, "Ultracs Tutorials", 5000, 5);
return 1;
}
SetPlayerPos(playerid, XX,YY,ZZ);

In loc de "XX,YY,ZZ" Vom pune cordonatele locului unde vream sa fim teleportati.
Cum Putem afla cordonatele ? Pentru a afla cordonatele suntem nevoiti sa intram in JOC , si sa mergem in locul in care dorim sa fim telportati , pentru asta vom folosi /save
Dupa ce am dat /save si am ales locatia , mergem in Foldarul cu GTA , si cautam savepotison.txt , acolo vom gasti cordonatele resepctiva X,Y,Z.

GameTextForPlayer(playerid, "asdfgh", 5000, 5);

In loc de "asdfgh" , vom adauga un text care dorim sa fie transmis aceluia , care foloseste commanda respectiva.

Cum Cream un Object in joc ?

CreateObject(objectid, Float:X, Float:Y, Float:Z);
Si Apoi bagam la OnGameModeinit , pentru a apare objectul in joc !

Pentru X,Y,Z trebuie inlocuite cu niste numere , care le gasim cu /save in joc ( ne ducem unde dorim sa fie obiect ) Si gasim Cords in Foldarul cu GTA .

Si inlocuim cu X,Y,Z!