SA-MP Forums Archive
teleport 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: teleport command (/showthread.php?tid=596394)



teleport command - GeneralAref - 17.12.2015

this is team teleport command but not works. can you fix it?
Код:
CMD:tget(playerid, params[])
{
    new adminname[MAX_PLAYER_NAME], Team, Float:x, Float:y, Float:z;
    if(PlayerInfo[playerid][pAdmin] >=4 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "i", Team)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /tget [Team id]");
        if (Team > 2 || Team < 1 ) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid team id: 1-2!");
		GetPlayerName(playerid, adminname, sizeof(adminname));
        GetPlayerPos(playerid, x, y, z);
        for(new i=0; i<MAX_PLAYERS; i++)
        if(IsPlayerConnected(i))
        {
	        if(GetPlayerTeam(i) == Team)
		    {
		        if (aDuty[playerid] == 1) return 1;
		        ResetPlayerWeapons(playerid);
	            SetPlayerPos(playerid, x+0.303, y+1.7418, z);
	            TogglePlayerControllable(playerid, 0);
	            if (Team == 1)
		        {
		        new str[128];
		        format(str,128,"%s [ID %d] has teleported team internationalforces!",adminname, playerid);
		        SendClientMessageToAll(COLOR_BLUE,str);
		        }
		        if (Team == 2)
		        {
		        new str[128];
		        format(str,128,"%s [ID %d] has teleported team Daesh!",adminname, playerid);
		        SendClientMessageToAll(COLOR_BLUE,str);
		        }
		    }
		}
        return 1;
    }
    else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}



Re: teleport command - SupperRobin6394 - 17.12.2015

Код:
CMD:tget(playerid, params[])
{
	new adminname[MAX_PLAYER_NAME], Team, Float:x, Float:y, Float:z;
	if(PlayerInfo[playerid][pAdmin] >=4 || IsPlayerAdmin(playerid))
	{
		if(sscanf(params, "i", Team)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /tget [Team id]");
		if(Team == 2 || Team == 1) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid team id: 1-2!");
		GetPlayerName(playerid, adminname, sizeof(adminname));
		GetPlayerPos(playerid, x, y, z);
		for(new i=0; i<MAX_PLAYERS; i++)
		if(IsPlayerConnected(i))
		{
			if(GetPlayerTeam(i) == Team)
			{
				if (aDuty[playerid] == 1) return 1;
				ResetPlayerWeapons(playerid);
				SetPlayerPos(playerid, x+0.303, y+1.7418, z);
				TogglePlayerControllable(playerid, 0);
				if(Team == 1)
				{
					new str[128];
					format(str,128,"%s [ID %d] has teleported team internationalforces!",adminname, playerid);
					SendClientMessageToAll(COLOR_BLUE,str);
				}
				if(Team == 2)
				{
					new str[128];
					format(str,128,"%s [ID %d] has teleported team Daesh!",adminname, playerid);
					SendClientMessageToAll(COLOR_BLUE,str);
				}
			}
		}
		return 1;
	}
	else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}



Re: teleport command - GeneralAref - 17.12.2015

I say fix it and not destroy it.
1 and 2 team id.
Код:
if(Team == 2 || Team == 1) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid team id: 1-2!")



Re: teleport command - Amunra - 17.12.2015

Whats wrong of This help ?


Re: teleport command - GeneralAref - 17.12.2015

if admin type 1 or 2 Sees that massage.


Re: teleport command - xTURBOx - 17.12.2015

Try
PHP код:
CMD:tget(playeridparams[])
{
    new 
adminname[MAX_PLAYER_NAME], TeamFloat:xFloat:yFloat:z;
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
    {
        if(
sscanf(params"i"Team)) return SendClientMessage(playeridCOLOR_RED"USAGE: /tget [Team id]");
        if(
Team || Team 1) return SendClientMessage(playeridCOLOR_RED,"[ERROR]: Valid team id: 1-2!");
        
GetPlayerName(playeridadminnamesizeof(adminname));
        
GetPlayerPos(playeridxyz);
        for(new 
i=0i<MAX_PLAYERSi++)
        if(
IsPlayerConnected(i))
        {
            if(
Team == 1)
            {
                if(
GetPlayerTeam(i) == 1)
                {
                    new 
str[128];
                    
format(str,128,"%s [ID %d] has teleported team internationalforces!",adminnameplayerid);
                    
SendClientMessageToAll(COLOR_BLUE,str);
                    
ResetPlayerWeapons(i);
                    
SetPlayerPos(ix+0.303y+1.7418z);
                    
TogglePlayerControllable(playerid0);
                }
            }
            if(
Team == 2)
            {
                if(
GetPlayerTeam(i) == 2)
                {
                    new 
str[128];
                    
format(str,128,"%s [ID %d] has teleported team Daesh!",adminnameplayerid);
                    
SendClientMessageToAll(COLOR_BLUE,str);
                    
ResetPlayerWeapons(i);
                    
SetPlayerPos(ix+0.303y+1.7418z);
                    
TogglePlayerControllable(playerid0);
                }
            }
        }
        return 
1;
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");




Re: teleport command - GeneralAref - 17.12.2015

not works.team not teleported and i cant see massages.


Re: teleport command - AmirAmani - 17.12.2015

PHP код:
Code:
CMD:tget(playeridparams[])
{
    new 
adminname[MAX_PLAYER_NAME], TeamFloat:xFloat:yFloat:z;
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
    {
        if(
sscanf(params"i"Team)) return SendClientMessage(playeridCOLOR_RED"USAGE: /tget [Team id]");
        if(
Team == || Team == 1) return SendClientMessage(playeridCOLOR_RED,"[ERROR]: Valid team id: 1-2!");
        
GetPlayerName(playeridadminnamesizeof(adminname));
        
GetPlayerPos(playeridxyz);
        for(new 
i=0i<MAX_PLAYERSi++)
        if(
IsPlayerConnected(i))
        {
            if(
GetPlayerTeam(i) == Team)
            {
                if (
Aduty[playerid] == 1) return 1;
                
ResetPlayerWeapons (playerid);
                
SetPlayerPos(playeridx+0.303y+1.7418z);
                
TogglePlayerControllable(playerid0);
                if(
Team == 1)
                {
                    new 
str[128];
                    
format(str,128,"%s [ID %d] has teleported team internationalforces!",adminnameplayerid);
                    
SendClientMessageToAll(COLOR_BLUE,str);
                }
                if(
Team == 2)
                {
                    new 
str[128];
                    
format(str,128,"%s [ID %d] has teleported team Daesh!",adminnameplayerid);