Jump to content

Cerere tutorial comanda /gotoxyz !


AlyN.

Recommended Posts

Descriere tutorial:Am si eu nevoie de putin ajutor.. Cum pot face comanda /gotoxyz ? Vreau ca aceasta comanda sa ma poata teleporta atat in interioare cat si la orice alte coordonate puse de mine. Multumesc !

Link to comment
Share on other sites

	if(strcmp(cmd, "/gotoxyz", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] < 6)
	        {
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendUsage(playerid,"/gotoxyz [x] [y] [z] [interior]");
				return 1;
			}
			new x = strval(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendUsage(playerid,"/gotoxyz [x] [y] [z] [interior]");
				return 1;
			}
			new y = strval(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendUsage(playerid,"/gotoxyz [x] [y] [z] [interior]");
				return 1;
			}
			new z = strval(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendUsage(playerid,"/gotoxyz [x] [y] [z] [interior]");
				return 1;
			}
			new interior = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
				SetPlayerPos(playerid, x, y, z);
				format(string,sizeof(string),"Ai fost teleportat la coordonatele x = %d, y = %d, z = %d, interior %d.",x,y,z,interior);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SetPlayerVirtualWorld(playerid, 0);
				SetPlayerInterior(playerid,interior);
				GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, 256, "AdmInfo:{FFFFFF} Admin %s s-a teleportat. (/gotxyz)", sendername);
				ABroadCast(COLOR_LIGHTRED,string,5);
			}
			else
			{
				SendError(playerid,cmd);
			}
		}
		return 1;
	} 

Comanda am luat-o din GM-ul la care lucrez. Poti renunta la liniile:

                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, 256, "AdmInfo:{FFFFFF} Admin %s s-a teleportat. (/gotxyz)", sendername);
                                ABroadCast(COLOR_LIGHTRED,string,5);
Edited by blueeemi
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.