Jump to content
  • 0

Probleme /gotoxyz


barni

Question

Bună ziua dragilor, aş dori să mă ajutaţi şi pe mine într-o problemă.

As dori sa fac dupa modelul de mai jos o coamnda de tip /gotoxyz care sa afiseze catre admin (level 1) sytanxa de ''/gotoxyz [coordonate] [int] si tot incerc sa o fac si imi da erori, ma puteti ajuta?

template comanda.

	    if(strcmp(cmd, "/gotolv", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdministrator] >= 1)
            {
                if(GetPlayerState(playerid) == 2)
                {
                    new tmpcar = GetPlayerVehicleID(playerid);
                    SetVehiclePos(tmpcar, 1699.2, 1435.1, 10.7);
                }
                else
                {
                    SetPlayerPos(playerid, 1699.2,1435.1, 10.7);
                }
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Nu esti autorizat sa folosesti comanda!");
            }
        }
        return 1;
    }
	

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
CMD:gotoxyz(playerid, params[])
{
	if (PlayerInfo[playerid][pAdministrator] < 1)
	{
		SendClientMessage(playerid, COLOR_GREY,"Nu esti autorizat sa folosesti aceasta comanda.");
		return 1;
	}
		
	new Float:x, Float:y, Float:z;
	
	if(sscanf(params, "fff", x,y,z))
	{
		return SendClientMessage(playerid,COLOR_GREY,"USAGE: /gotopos [X] [Y] [Z]");
	}
	else
	{
		SetPlayerPos(playerid, x, y, z);
		return 1;
	

(dacă vrei să o faci pe strcmp, editează doar din CMD:gotoxyz(playerid, params[]) in: if(strcmp(cmd, "/gotoxyz", true) == 0)

Edited by AndreiAdv
Link to comment
Share on other sites

  • 0
Acum 5 minute, AndreiAdv a spus:

CMD:gotoxyz(playerid, params[])
{
	if (PlayerInfo[playerid][pAdministrator] < 1)
	{
		SendClientMessage(playerid, COLOR_GREY,"Nu esti autorizat sa folosesti aceasta comanda.");
		return 1;
	}
		
	new Float:x, Float:y, Float:z;
	
	if(sscanf(params, "fff", x,y,z))
	{
		return SendClientMessage(playerid,COLOR_GREY,"USAGE: /gotopos [X] [Y] [Z]");
	}
	else
	{
		SetPlayerPos(playerid, x, y, z);
		return 1;
	

(dacă vrei să o faci pe strcmp, editează doar din CMD:gotoxyz(playerid, params[]) in: if(strcmp(cmd, "/gotoxyz", true) == 0)

imi umple gm-ul de erori daca pun asta in gamemode. 

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.