help me goto
#1

Hey Why i /goto 0

to long i fixed it..

That does't teleport And that say

SendClientMessage(playerid, COLOR_WHITE,"USAGE: /goto [playerid] OR /goto [area]");
SendClientMessage(playerid, COLOR_GREY,"AREAS: lsair sfair lvair lspd");
SendClientMessage(playerid, COLOR_GREY,"AREAS: skyscraper chiliad area51 airstrip bayside quarry dam bank pier");
SendClientMessage(playerid, COLOR_GREY,"AREAS: underwater jet battlefield 8track kickstart dirtbike bloodbowl gym");

here the Code
Код:
	if(!strcmp(cmd,"/goto",true) || !strcmp(cmd,"/gotoid",true))
	{
	    if(!(PlayerInfo[playerid][pAdmin] >= 2))
	        return SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
     	if(PlayerInfo[playerid][pHelper] >= 1)
	    // process command
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
	    {
	        SendClientMessage(playerid, COLOR_WHITE,"USAGE: /goto [playerid] OR /goto [area]");
	        SendClientMessage(playerid, COLOR_GREY,"AREAS: lsair sfair lvair lspd");
	        SendClientMessage(playerid, COLOR_GREY,"AREAS: skyscraper chiliad area51 airstrip bayside quarry dam bank pier");
			SendClientMessage(playerid, COLOR_GREY,"AREAS: underwater jet battlefield 8track kickstart dirtbike bloodbowl gym");
	        return 1;
		}
		new
		    p=1,
			Float:a = GetPlayerFacingAngle(playerid,a),
			destination[64] = " ",
			lookupid = ReturnUser(tmp);

		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) p=0;
		if(lookupid != INVALID_PLAYER_ID)
		{
	    	if(lookupid != playerid)
	    	{
	    		if(!gPlayerLogged[lookupid])
					return SendClientMessage(playerid, COLOR_GRAD2,"That player hasn't spawned yet.");
				if(GetPlayerState(lookupid) == PLAYER_STATE_SPECTATING)
					return SendClientMessage(playerid, COLOR_GRAD2,"That player is spectating someone.");
			}
			new
				Float:x,
				Float:y,
				Float:z,
				i = GetPlayerInterior(lookupid),
				v = GetPlayerVirtualWorld(lookupid);
			if(IsPlayerInAnyVehicle(lookupid))
			{
			    GetVehicleZAngle(GetPlayerVehicleID(lookupid),a);
			} else {
				GetPlayerFacingAngle(lookupid,a);
			}
			GetPlayerPos(lookupid,x,y,z);
			Teleport(playerid,x,y+2,z,a,i,v,p);
			destination = PlayerName(lookupid);
		}
		else if(!strcmp(tmp,"lspd",true) || !strcmp(tmp,"ls",true))
		{
		    destination = "Los Santos Police Department";
		    Teleport(playerid,1529.6,-1691.2,13.3,a,0,0,p);
		}
		else if(!strcmp(tmp,"int1",true))
		{
		    destination = "Interior 1";
		    Teleport(playerid,1411.1451,-0.5155,1000.9236,a,1,0,p);
		}
		else if(!strcmp(tmp,"gym",true))
		{
		    destination = "Los Santos GYM";
		    Teleport(playerid,2225.4001,-1724.4464,13.5632,a,0,0,p);
		}
		else if(!strcmp(tmp,"lsair",true))
		{
		    destination = "Los Santos Airport";
		    Teleport(playerid,1934.9127,-2290.6362,13.5469,a,0,0,p);
		}
		else if(!strcmp(tmp,"sfair",true) || !strcmp(tmp,"sf",true))
		{
		    destination = "San Fierro Airport";
		    Teleport(playerid,-1417.0,-295.8,14.1,a,0,0,p);
		}
		else if(!strcmp(tmp,"lvair",true) || !strcmp(tmp,"lv",true))
		{
		    destination = "Las Venturas Airport";
		    Teleport(playerid,1699.2,1435.1, 10.7,a,0,0,p);
		}
		else if(!strcmp(tmp,"jet",true))
		{
		    destination = "private jet";
		    Teleport(playerid,1.71875, 30.4062, 1200.34,a,1,0,0);
		}
		else if (!strcmp(tmp,"chiliad",true))
		{
		    destination = "Mt. Chiliad";
		    Teleport(playerid,-2317.5325,-1644.9664,483.7031,a,0,0,p);
		}
		else if (!strcmp(tmp,"area51",true))
		{
		    destination = "Area 51";
		    Teleport(playerid,202.1886,1881.4122,17.2199,37.8779,0,0,p);
		}
		else if (!strcmp(tmp,"airstrip",true))
		{
		    destination = "Desert Airstrip";
		    Teleport(playerid,357.5273,2513.8701,16.5856,a,0,0,p);
		}
		else if (!strcmp(tmp,"skyscraper",true) || !strcmp(tmp,"sky",true))
		{
		    destination = "the Skyscraper";
		    Teleport(playerid,1543.9886,-1353.7587,329.4735,a,0,0,p);
		}
		else if (!strcmp(tmp,"bayside",true))
		{
		    destination = "Bayside Heliport";
		    Teleport(playerid,-2252.2944,2335.5396,4.8125,a,0,0,p);
		}
		else if (!strcmp(tmp,"underwater",true) || !strcmp(tmp,"under",true))
		{
		    destination = "under the sea";
		    Teleport(playerid,-1005.3044,657.4559,-39.0847,a,0,0,p);
		}
		else if (!strcmp(tmp,"bank",true))
		{
		    destination = "The Bank";
		    Teleport(playerid,1462.395751,-1016.391174,25.84375,a,0,0,p);
		}
		else if (!strcmp(tmp,"pier",true))
		{
		    destination = "the fishing pier";
		    Teleport(playerid,364.9920,-2059.7288,15.3990,a,0,0,p);
		}
		else if (!strcmp(tmp,"battlefield",true) || !strcmp(tmp,"battle",true))
		{
		    destination = "the battlefield";
	   	 	Teleport(playerid,-972.4957,1060.9830,1345.6690,a,10,0,p);
		}
		else if (!strcmp(tmp,"dam",true))
		{
	    	destination = "the Sherman Dam";
	    	Teleport(playerid,-715.0000,2062.0000,60.0000,a,0,0,p);
		}
		else if (!strcmp(tmp,"bloodbowl",true))
		{
		    destination = "Bloodbowl Arena";
		    Teleport(playerid,-1394.5928,996.4797,1033.8864,a,15,0,p);
		}
		else if (!strcmp(tmp,"8track",true))
		{
		    destination = "8-Track Stadium";
		    Teleport(playerid,-1406.3815,-262.7644,1043.4290,346.8336,7,0,p);
		}
		else if (!strcmp(tmp,"dirtbike",true))
		{
		    destination = "Dirtbike Stadium";
		    Teleport(playerid,-1436.2065,-642.5217,1049.5261,167.3703,4,0,p);
		}
		else if (!strcmp(tmp,"kickstart",true))
		{
		    destination = "Kickstart Stadium";
		    Teleport(playerid,-1447.2618,1604.3374,1052.5220,263.7223,14,0,p);
		}
		else if (!strcmp(tmp,"quarry",true))
		{
	 		destination = "Hunter Quarry";
	    	Teleport(playerid,609.8776,867.3369,-42.2692,a,0,0,p);
		}
  		else
		{
			return SendClientMessage(playerid, COLOR_FADE1,"Invalid destination.");
		}
		// format string and send to player
  		format(string, sizeof(string),"Teleporting to %s",destination);
		SendClientMessage(playerid, COLOR_GRAD2,string);
		return 1;
	}
Reply
#2

Quote:
Originally Posted by NewYork-Roleplay
Посмотреть сообщение
Hey Why i /goto 0

to long i fixed it..

That does't teleport And that say

SendClientMessage(playerid, COLOR_WHITE,"USAGE: /goto [playerid] OR /goto [area]");
SendClientMessage(playerid, COLOR_GREY,"AREAS: lsair sfair lvair lspd");
SendClientMessage(playerid, COLOR_GREY,"AREAS: skyscraper chiliad area51 airstrip bayside quarry dam bank pier");
SendClientMessage(playerid, COLOR_GREY,"AREAS: underwater jet battlefield 8track kickstart dirtbike bloodbowl gym");

here the Code
Код:
	if(!strcmp(cmd,"/goto",true) || !strcmp(cmd,"/gotoid",true))
	{
	    if(!(PlayerInfo[playerid][pAdmin] >= 2))
	        return SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
     	if(PlayerInfo[playerid][pHelper] >= 1)
	    // process command
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
	    {
	        SendClientMessage(playerid, COLOR_WHITE,"USAGE: /goto [playerid] OR /goto [area]");
	        SendClientMessage(playerid, COLOR_GREY,"AREAS: lsair sfair lvair lspd");
	        SendClientMessage(playerid, COLOR_GREY,"AREAS: skyscraper chiliad area51 airstrip bayside quarry dam bank pier");
			SendClientMessage(playerid, COLOR_GREY,"AREAS: underwater jet battlefield 8track kickstart dirtbike bloodbowl gym");
	        return 1;
		}
		new
		    p=1,
			Float:a = GetPlayerFacingAngle(playerid,a),
			destination[64] = " ",
			lookupid = ReturnUser(tmp);

		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) p=0;
		if(lookupid != INVALID_PLAYER_ID)
		{
	    	if(lookupid != playerid)
	    	{
	    		if(!gPlayerLogged[lookupid])
					return SendClientMessage(playerid, COLOR_GRAD2,"That player hasn't spawned yet.");
				if(GetPlayerState(lookupid) == PLAYER_STATE_SPECTATING)
					return SendClientMessage(playerid, COLOR_GRAD2,"That player is spectating someone.");
			}
			new
				Float:x,
				Float:y,
				Float:z,
				i = GetPlayerInterior(lookupid),
				v = GetPlayerVirtualWorld(lookupid);
			if(IsPlayerInAnyVehicle(lookupid))
			{
			    GetVehicleZAngle(GetPlayerVehicleID(lookupid),a);
			} else {
				GetPlayerFacingAngle(lookupid,a);
			}
			GetPlayerPos(lookupid,x,y,z);
			Teleport(playerid,x,y+2,z,a,i,v,p);
			destination = PlayerName(lookupid);
		}
		else if(!strcmp(tmp,"lspd",true) || !strcmp(tmp,"ls",true))
		{
		    destination = "Los Santos Police Department";
		    Teleport(playerid,1529.6,-1691.2,13.3,a,0,0,p);
		}
		else if(!strcmp(tmp,"int1",true))
		{
		    destination = "Interior 1";
		    Teleport(playerid,1411.1451,-0.5155,1000.9236,a,1,0,p);
		}
		else if(!strcmp(tmp,"gym",true))
		{
		    destination = "Los Santos GYM";
		    Teleport(playerid,2225.4001,-1724.4464,13.5632,a,0,0,p);
		}
		else if(!strcmp(tmp,"lsair",true))
		{
		    destination = "Los Santos Airport";
		    Teleport(playerid,1934.9127,-2290.6362,13.5469,a,0,0,p);
		}
		else if(!strcmp(tmp,"sfair",true) || !strcmp(tmp,"sf",true))
		{
		    destination = "San Fierro Airport";
		    Teleport(playerid,-1417.0,-295.8,14.1,a,0,0,p);
		}
		else if(!strcmp(tmp,"lvair",true) || !strcmp(tmp,"lv",true))
		{
		    destination = "Las Venturas Airport";
		    Teleport(playerid,1699.2,1435.1, 10.7,a,0,0,p);
		}
		else if(!strcmp(tmp,"jet",true))
		{
		    destination = "private jet";
		    Teleport(playerid,1.71875, 30.4062, 1200.34,a,1,0,0);
		}
		else if (!strcmp(tmp,"chiliad",true))
		{
		    destination = "Mt. Chiliad";
		    Teleport(playerid,-2317.5325,-1644.9664,483.7031,a,0,0,p);
		}
		else if (!strcmp(tmp,"area51",true))
		{
		    destination = "Area 51";
		    Teleport(playerid,202.1886,1881.4122,17.2199,37.8779,0,0,p);
		}
		else if (!strcmp(tmp,"airstrip",true))
		{
		    destination = "Desert Airstrip";
		    Teleport(playerid,357.5273,2513.8701,16.5856,a,0,0,p);
		}
		else if (!strcmp(tmp,"skyscraper",true) || !strcmp(tmp,"sky",true))
		{
		    destination = "the Skyscraper";
		    Teleport(playerid,1543.9886,-1353.7587,329.4735,a,0,0,p);
		}
		else if (!strcmp(tmp,"bayside",true))
		{
		    destination = "Bayside Heliport";
		    Teleport(playerid,-2252.2944,2335.5396,4.8125,a,0,0,p);
		}
		else if (!strcmp(tmp,"underwater",true) || !strcmp(tmp,"under",true))
		{
		    destination = "under the sea";
		    Teleport(playerid,-1005.3044,657.4559,-39.0847,a,0,0,p);
		}
		else if (!strcmp(tmp,"bank",true))
		{
		    destination = "The Bank";
		    Teleport(playerid,1462.395751,-1016.391174,25.84375,a,0,0,p);
		}
		else if (!strcmp(tmp,"pier",true))
		{
		    destination = "the fishing pier";
		    Teleport(playerid,364.9920,-2059.7288,15.3990,a,0,0,p);
		}
		else if (!strcmp(tmp,"battlefield",true) || !strcmp(tmp,"battle",true))
		{
		    destination = "the battlefield";
	   	 	Teleport(playerid,-972.4957,1060.9830,1345.6690,a,10,0,p);
		}
		else if (!strcmp(tmp,"dam",true))
		{
	    	destination = "the Sherman Dam";
	    	Teleport(playerid,-715.0000,2062.0000,60.0000,a,0,0,p);
		}
		else if (!strcmp(tmp,"bloodbowl",true))
		{
		    destination = "Bloodbowl Arena";
		    Teleport(playerid,-1394.5928,996.4797,1033.8864,a,15,0,p);
		}
		else if (!strcmp(tmp,"8track",true))
		{
		    destination = "8-Track Stadium";
		    Teleport(playerid,-1406.3815,-262.7644,1043.4290,346.8336,7,0,p);
		}
		else if (!strcmp(tmp,"dirtbike",true))
		{
		    destination = "Dirtbike Stadium";
		    Teleport(playerid,-1436.2065,-642.5217,1049.5261,167.3703,4,0,p);
		}
		else if (!strcmp(tmp,"kickstart",true))
		{
		    destination = "Kickstart Stadium";
		    Teleport(playerid,-1447.2618,1604.3374,1052.5220,263.7223,14,0,p);
		}
		else if (!strcmp(tmp,"quarry",true))
		{
	 		destination = "Hunter Quarry";
	    	Teleport(playerid,609.8776,867.3369,-42.2692,a,0,0,p);
		}
  		else
		{
			return SendClientMessage(playerid, COLOR_FADE1,"Invalid destination.");
		}
		// format string and send to player
  		format(string, sizeof(string),"Teleporting to %s",destination);
		SendClientMessage(playerid, COLOR_GRAD2,string);
		return 1;
	}
Would suggest you to use zcmd.

pawn Код:
command(goto, playerid, params[])
{
     if(strmatch(params, "ls")) return SetPlayerPos(playerid, x, y, z);
     if(strmatch(params, "sf")) return SetPlayerPos(playerid, x, y, z);
     if(strmatch(params, "lv")) return SetPlayerPos(playerid, x, y, z);
     SendClientMessage(playerid, COLOR, "Usage: /goto ' location '");
     SendClientMessage(playerid, COLOR, "Locations: Ls, Sf, Lv");
     return 1;
}
Looks like shit, but should work.
Reply
#3

I mean /goto Teleport to player that i know..

plz help me to long ago.. i fixed it
Reply
#4

Quote:
Originally Posted by NewYork-Roleplay
Посмотреть сообщение
I mean /goto Teleport to player that i know..
pawn Код:
command(goto, playerid, params[])
{
     new uID;
     if(sscanf(params, "u", uID)) return SendClientMessage(playerid, COLOR, "Usage: /goto [ Id ]");
     new Float: POS[3];
     GetPlayerPos(uID, POS[0], POS[1], POS[2]);
     SetPlayerPos(playerid, POS[0], POS[1], POS[2]);
     return 1;
}
Reply
#5

lets me try it
Reply
#6

C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24981 ) : error 017: undefined symbol "command"
C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24981 ) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24982 ) : warning 217: loose indentation
C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24984 ) : error 017: undefined symbol "params"
C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24990 ) : warning 225: unreachable code
C:\Documents and Settings\Kie\Desktop\RXRP\gamemodes\GLRP.pwn(24990 ) : warning 217: loose indentation









Please Help me..
Reply
#7

This command is in ZCMD system, if you're using dcmd or strcmp, just convert it.
Reply
#8

okay Lets me try again
Reply
#9

can you teach me? i'm new
Reply
#10

Quote:
Originally Posted by NewYork-Roleplay
Посмотреть сообщение
can you teach me? i'm new
Goto search > search for ZCMD, when you found the plugin released by 'zeex' download it, extract the plugin in the plugins folder located at your server's main folder (where samp-server is) if it doesen't exist create it.

Then extract the .inc file in pawno > includes and on top of your script put #include <zcmd>. Then click compile now it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)