SA-MP Forums Archive
/get command. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /get command. (/showthread.php?tid=345008)



/get command. - Attias - 23.05.2012

It doesn't get the playerid's vehicle to the user of /get position:

Код:
	if(!strcmp(cmd,"/get",true))
	{
	if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"[Error:] You need to be a level 1 admin");
	new Float:Pos[3];
	tmp = strtok(cmdtext,idx);
	new id = strval(tmp);
	if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"[Usage:] /Get [ID]");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"[Error:] Invalid ID");
	if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"[Error:] You need to be a level 1 admin");
    if(playerid == id) return SendClientMessage(playerid,COLOR_RED,"[Error:] You can't teleport yourself");
	GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
	SetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
	if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0],Pos[1],Pos[2]);
	format(string,sizeof(string),"[Server:] You have teleported %s to you",GetName(id));
	SendClientMessage(playerid,COLOR_WHITE,string);
	return 1;
	}