Jump to content
  • 0

Ajutor /goto si /gethere


JoKeRy

Question

GM-ul este Godfather. Deci asta e comanda /goto:

if(strcmp(cmd, "/goto", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /goto [playerid/PartOfName]");
				return 1;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo;
			plo = ReturnUser(tmp);
			new playa;
  			playa = ReturnUser(tmp);
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
					{
						if(Spectate[playerid] != 255)
						{
							Spectate[playerid] = 256;
						}
						GetPlayerPos(plo, plocx, plocy, plocz);
						if(PlayerInfo[plo][pInt] > 0)
						{
							SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
							PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
							PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
						}
						if(PlayerInfo[plo][pInt] == 10 && PlayerInfo[plo][pLocal] == 500)
			            {
                           SendClientMessage(playerid, COLOR_GRAD2, "You can`t go to this player");
				           return 1;
			            }
						if(PlayerInfo[playerid][pInt] == 0)
						{
							SetPlayerInterior(playerid,0);
						}
						if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
						{
							SetPlayerInterior(playerid,1);
							PlayerInfo[playerid][pInt] = 1;
						}
						if (GetPlayerState(playerid) == 2)
						{
							new tmpcar = GetPlayerVehicleID(playerid);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
							TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
						}
						else
						{
							SetPlayerPos(playerid,plocx,plocy+2, plocz);
						}
						SendClientMessage(playerid, COLOR_GRAD1, "   {9D0000}*{F6C861}You have been teleported");
						if (PlayerInfo[playerid][pAdmin] >= 1)
						{
 							GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
						    format(string, sizeof(string), " Admin {F81414}%s {AFAFAF}has teleported at you!",sendername);
				            SendClientMessage(plo, COLOR_GREY, string);
							format(string,sizeof(string), "{FF2C00}[AdmWarning]: {FFFFFF}Admin {33FF33}%s {FFFFFF}Has teleported to {33FF33}%s",sendername, giveplayer);
							ABroadCast(COLOR_LIGHTRED,string, 5);
				        }
				        if (PlayerInfo[playerid][pHelper] >= 1)
						{
 							GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string,sizeof(string), "{FF2C00}[AdmWarning]: {FFFFFF}Helper {33FF33}%s {FFFFFF}Has teleported to {33FF33}%s ",sendername, giveplayer);
							ABroadCast(COLOR_LIGHTRED,string, 5);
						    format(string, sizeof(string), " Helper {F81414}%s {AFAFAF}has teleported at you!",sendername);
				            SendClientMessage(plo, COLOR_GREY, string);
				        }
						SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
						HouseEntered[playerid] = HouseEntered[plo];
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", plo);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Si asta e comanda /gethere:
if(strcmp(cmd, "/gethere", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /gethere [playerid/PartOfName]");
				return 1;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo;
			plo = ReturnUser(tmp);
			GetPlayerName(playerid,sendername,sizeof(sendername));
			GetPlayerName(plo, giveplayer, sizeof(giveplayer));
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[plo][pAdmin] > 1337)
					{
						SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");
						return 1;
					}
					/*else if(AFKCheck[plo] > 0)
				    {
                        SendClientMessage(playerid, COLOR_GREY, "   Can't use this command on a afk player !");
					    return 1;
		            }*/
		            if(PlayerInfo[playerid][pInt] == 10 && PlayerInfo[playerid][pLocal] == 500)
			        {
                        SendClientMessage(playerid, COLOR_GRAD2, "You can`t use this command in this place");
				        return 1;
			        }
			        if(PlayerInfo[plo][pJailed] == 1)
			        {
                        SendClientMessage(playerid,COLOR_GREY,"   You can`t use this command on that player because is in jail !");
                        return 1;
                    }
                    if(WantedLevel[plo] >= 1)
                    {
                        SendClientMessage(playerid,COLOR_GREY,"   You can`t use this command on that player, is currently Wanted !");
                        return 1;
                    }
					if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
					{
						GetPlayerPos(playerid, plocx, plocy, plocz);
						if(PlayerInfo[playerid][pInt] > 0)
						{
							SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
							PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
							PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
						}
						if(PlayerInfo[playerid][pInt] == 0)
						{
							SetPlayerInterior(plo,0);
						}
						if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
						{
							SetPlayerInterior(plo,1);
							PlayerInfo[plo][pInt] = 1;
						}
						if (GetPlayerState(plo) == 2)
						{
							TelePos[plo][0] = 0.0;
							TelePos[plo][1] = 0.0;
							new tmpcar = GetPlayerVehicleID(plo);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
						}
						else
						{
							SetPlayerPos(plo,plocx,plocy+2, plocz);
						}
						SendClientMessage(plo, COLOR_GRAD1, "   You have been teleported");
						format(string,sizeof(string), "{FF2C00}[AdmWarning]: {33FF33}%s {FFFFFF}Has teleported {33FF33}%s (%d) {FFFFFF}to Himself",sendername,giveplayer,plo);
						ABroadCast(COLOR_LIGHTRED,string, 5);
						SetPlayerInterior(plo,GetPlayerInterior(playerid));
						SetPlayerVirtualWorld(plo,GetPlayerVirtualWorld(playerid));
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", plo);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

Eu as vrea asa: cand dau /gethere sa ii apara celui pe care l-am adus la mine asa: "Admin/Helper %s has teleported you at him!" (Daca e admin sa apara Admin si daca e helper sa apara Helper) Si la /goto invers, ii apare celui la care m-am teleportat ca eu m-am teleportat la el dar nu imi apare mie, eu as vrea sa imi apara mie cand dau asa: "You have been teleported at %s!".

430x73_FFFFFF_FF9900_000000_000000.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

POFTIM =)

[pawn] if(strcmp(cmd, "/goto", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Tasteazã:{FFFFFF} /goto [playerid/PartOfName]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = ReturnUser(tmp);

new playa;

  playa = ReturnUser(tmp);

if (IsPlayerConnected(plo))

{

    if(plo != INVALID_PLAYER_ID)

    {

if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

{

if(Spectate[playerid] != 255)

{

Spectate[playerid] = 256;

}

GetPlayerPos(plo, plocx, plocy, plocz);

if(PlayerInfo[plo][pInt] > 0)

{

SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);

PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];

PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];

}

if(PlayerInfo[plo][pInt] == 10 && PlayerInfo[plo][pLocal] == 500)

            {

                          SendClientMessage(playerid, COLOR_GRAD2, "You can`t go to this player");

          return 1;

            }

if(PlayerInfo[playerid][pInt] == 0)

{

SetPlayerInterior(playerid,0);

}

if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8

{

SetPlayerInterior(playerid,1);

PlayerInfo[playerid][pInt] = 1;

}

if (GetPlayerState(playerid) == 2)

{

new tmpcar = GetPlayerVehicleID(playerid);

SetVehiclePos(tmpcar, plocx, plocy+4, plocz);

TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;

}

else

{

SetPlayerPos(playerid,plocx,plocy+2, plocz);

}

SendClientMessage(playerid, COLOR_GRAD1, "  {9D0000}*{F6C861}You have been teleported");

if (PlayerInfo[playerid][pAdmin] >= 1)

{

GetPlayerName(playa, giveplayer, sizeof(giveplayer));

                            GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), " Admin {F81414}%s {AFAFAF}has teleported at you!",sendername);

            SendClientMessage(plo, COLOR_GREY, string);

format(string,sizeof(string), "{DC0C0C}[info:] {FFFFFF}Admin {33FF33}%s {FFFFFF}Has teleported to {33FF33}%s",sendername, giveplayer);

ABroadCast(COLOR_LIGHTRED,string, 5);

        }

        if (PlayerInfo[playerid][pHelper] >= 1)

{

GetPlayerName(playa, giveplayer, sizeof(giveplayer));

                            GetPlayerName(playerid, sendername, sizeof(sendername));

format(string,sizeof(string), "{DC0C0C}[info:] {FFFFFF}Helper {33FF33}%s {FFFFFF}Has teleported to {33FF33}%s ",sendername, giveplayer);

ABroadCast(COLOR_LIGHTRED,string, 5);

    format(string, sizeof(string), " Helper {F81414}%s {AFAFAF}has teleported at you!",sendername);

            SendClientMessage(plo, COLOR_GREY, string);

        }

SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));

HouseEntered[playerid] = HouseEntered[plo];

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu ai rangul administrativ necesar!");

}

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", plo);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

si gethere

[pawn] if(strcmp(cmd, "/gethere", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Tasteazã:{FFFFFF} /gethere [playerid/PartOfName]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = ReturnUser(tmp);

GetPlayerName(playerid,sendername,sizeof(sendername));

GetPlayerName(plo, giveplayer, sizeof(giveplayer));

if (IsPlayerConnected(plo))

{

    if(plo != INVALID_PLAYER_ID)

    {

if (PlayerInfo[plo][pAdmin] > 1338)

{

SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");

return 1;

}

/*else if(AFKCheck[plo] > 0)

    {

                        SendClientMessage(playerid, COLOR_GREY, "  Can't use this command on a afk player !");

    return 1;

            }*/

            if(PlayerInfo[playerid][pInt] == 10 && PlayerInfo[playerid][pLocal] == 500)

        {

                        SendClientMessage(playerid, COLOR_GRAD2, "You can`t use this command in this place");

        return 1;

        }

        if(PlayerInfo[plo][pJailed] == 1)

        {

                        SendClientMessage(playerid,COLOR_GREY,"  You can`t use this command on that player because is in jail !");

                        return 1;

                    }

                    if(WantedLevel[plo] >= 1)

                    {

                        SendClientMessage(playerid,COLOR_GREY,"  You can`t use this command on that player, is currently Wanted !");

                        return 1;

                    }

if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

{

GetPlayerPos(playerid, plocx, plocy, plocz);

if(PlayerInfo[playerid][pInt] > 0)

{

SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);

PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];

PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];

}

if(PlayerInfo[playerid][pInt] == 0)

{

SetPlayerInterior(plo,0);

}

if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8

{

SetPlayerInterior(plo,1);

PlayerInfo[plo][pInt] = 1;

}

if (GetPlayerState(plo) == 2)

{

TelePos[plo][0] = 0.0;

TelePos[plo][1] = 0.0;

new tmpcar = GetPlayerVehicleID(plo);

SetVehiclePos(tmpcar, plocx, plocy+4, plocz);

}

else

{

SetPlayerPos(plo,plocx,plocy+2, plocz);

}

SendClientMessage(plo, COLOR_GRAD1, "  You have been teleported");

format(string,sizeof(string), "{DC0C0C}[info:] {FFFFFF}%s {FFFFFF}Has teleported {33FF33}%s (%d) {FFFFFF}to Himself",sendername,giveplayer,plo);

ABroadCast(COLOR_LIGHTRED,string, 5);

SetPlayerInterior(plo,GetPlayerInterior(playerid));

SetPlayerVirtualWorld(plo,GetPlayerVirtualWorld(playerid));

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu ai rangul administrativ necesar!");

}

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", plo);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

la /goto modifici linia aceasta:

format(string, sizeof(string), " Admin {F81414}%s {AFAFAF}has teleported at you!",sendername);
cu aceasta
format(string, sizeof(string), " Admin/Helper %s {AFAFAF}has teleported at you!",sendername);
si la /gethere modifici linia aceasta:
SendClientMessage(plo, COLOR_GRAD1, "   You have been teleported");
cu aceasta:
SendClientMessage(plo, COLOR_GRAD1, "You have been teleported to admin/helper");

<a href="http://www.game-state.com/94.177.106.162:7777/"><img src="http://www.game-state.com/94.177.106.162:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.com" style="border-style: none;" /></a>

Link to comment
Share on other sites

Tu cred ca n-ai inteles ce am vrut eu. Citeste cu atentie ce am cerut eu acolo.

//EDIT: Voi mai explica odata ce vreau eu sa schimb la aceste comenzi. La /goto vreau sa schimb "  *  You have been teleported" in " You have been teleported at %s!". La /gethere vreau sa schimb "  You have been teleported" in " Admin/Helper %s has teleported you at him!" (sa apara Admin daca e admin si Helper daca e helper). Va rog ajutati-ma am nevoie cat mai repede.

430x73_FFFFFF_FF9900_000000_000000.png

Link to comment
Share on other sites

Adaugi asta la sfarsitu gamemodeului

stock PlayerName(playerid)
{
    new nume[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nume, sizeof(nume));
    return nume;
}
Si adaugi la prima comanda
format(string ,sizeof(string),"{9D0000}*{F6C861}You have been teleported to %s",PlayerName(plo))
SendClientMessage(plo, -1, string);
iar la a doua
format(string ,sizeof(string),"{9D0000}*{F6C861}You have been teleported to %s",PlayerName(plo))
SendClientMessage(plo, -1, string);

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

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.