Jump to content
  • 0

Comanda /xgoto


bogdanel_hd

Question

Salut! Vreau sa precizez de la inceput ca sunt extrem de incepator in ale scriptingului. Am luat aceasta comanda dintr-un filterscript si am incercat sa o adaug in gamemode, nu imi da nicio eroare nimic, dar cand intru in joc si dau /xgoto nu realizeaza nimic.

dcmd_xgoto(playerid, params[])
{
	new Float:x, Float:y, Float:z;
		new string[100];
	if (PlayerInfo[playerid][pAdmin] >= 1)
	{
		
		if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/xgoto <X Float> <Y Float> <Z Float>\"");
		else
		{
		    if(IsPlayerInAnyVehicle(playerid))
		    {
		        SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
			}
			else
			{
		    	SetPlayerPos(playerid, x, y, z);
			}
		    format(string, sizeof(string), "You've set your coord to %f, %f, %f", x, y, z);
		    SendClientMessage(playerid, 0xBBBBBBAA, string);
	 	}
	}
 	return 1;
}	

Avand inca doua exemple de asemenea comenzi dmcd_spec, m-am luat dupa ea. De asemenea la OnPlayerCommandText am adaugat dcmd(xgoto, 4, cmdtext);. La fel luandu-ma dupa exemplu existent in gm, din pacate nu stiu ce trebuie sa insemne acel numar(constanta). Apreciez orice ajutor, cat mai detaliat. Multumesc!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 2
dcmd_gotopoint(playerid, params[])
{
	if(PlayerData[playerid][pAdmin] < 5) return 1; 
    new Float:X, Float:Y, Float:Z;
    if(!sscanf(params, "fff", X, Y, Z))
    {
		SetPlayerPos(playerid, X, Y, Z);
        SetCameraBehindPlayer(playerid);
		
        SendClientMessage(playerid, -1, "You have been teleported!");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "USAGE: /Gotopoint [X] [Y] [Z]");
        SendClientMessage(playerid, -1, "Teleports you to a point in world space.");
	}
	return 1;
}

incearca asta. Nu uita sa modifici variabilele.

Edited by webby
  • Upvote 1
Link to comment
Share on other sites

  • 0

din cate vad aceasta comanda seste axata doar pe goto, deci trebuie sa pui tu cordonatele respective sa te poti teleporta in locul dorit.

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

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.