Jump to content
  • 0

Question

Posted

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;
    }
	

5 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted
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. 

  • 0
Posted
Just now, barni said:

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

Ți-am spus mai sus dacă vrei să o faci pe strcmp.

În loc de CMD:gotoxyz(playerid, params[]) pui if(strcmp, cmd, "/gotoxyz", true) == 0)

  • 0
Posted
Acum 1 minut, AndreiAdv a spus:

Ți-am spus mai sus dacă vrei să o faci pe strcmp.

În loc de CMD:gotoxyz(playerid, params[]) pui if(strcmp, cmd, "/gotoxyz", true) == 0)

Asta am facut, add discord barni#4441

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.