Jump to content
  • 0

Problema getallhere


d@rK

Question

Can dau /getallhere apare: Administrator d@rK has teleported everyone to him  DE vreo 20 de ori :| :| :|

PAWNO:

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

{

    if(IsPlayerConnected(playerid))

{

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

{

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

    for(new i = 0; i < MAX_PLAYERS; i ++)

    {

        if(IsPlayerConnected(i))

        {

format(string, 256, "Administrator %s has teleported everyone to himself.", sendername);

BroadCast(COLOR_LIGHTRED,string);

new Float:ix, Float:iy, Float:iz;

GetPlayerPos(playerid, ix, iy, iz);

SetPlayerInterior(i, GetPlayerInterior(playerid));

SetPlayerPos(i, ix, iy, iz+1);

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

printf("[Warning] %s has teleported all players to him", sendername);

            ABroadCast(COLOR_LIGHTRED,string,1);

}

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "Nu ai acces la aceasta comanda!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");

}

return 1;

}[/pawn]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Logic ca apare...daca ai pus functia care trimite mesajul (BroadCast in cazul de fata) intr-un for.

Si nu apare de 20 de ori, apare in functie de numarul de playeri de pe server. Daca ai 400 de jucatori, apare de 400 de ori.

Scoate functia din for si pune-o mai jos putin.

Link to comment
Share on other sites

if(strcmp(cmd, "/getallhere", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdmin] >= 5)
			{
			    GetPlayerName(playerid, sendername, sizeof(sendername));
			    for(new i = 0; i < MAX_PLAYERS; i ++)
			    {
			        if(IsPlayerConnected(i))
			        {
						new Float:ix, Float:iy, Float:iz;
						GetPlayerPos(playerid, ix, iy, iz);
						SetPlayerInterior(i, GetPlayerInterior(playerid));
						SetPlayerPos(i, ix, iy, iz+1);
      					GetPlayerName(playerid, sendername, sizeof(sendername));
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "Nu ai acces la aceasta comanda!");
			}
			format(string, 256, "Administrator %s has teleported everyone to himself.", sendername);
			BroadCast(COLOR_LIGHTRED,string);
			printf("[Warning] %s has teleported all players to him", sendername);
            ABroadCast(COLOR_LIGHTRED,string,1);
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

plQ8h9B.jpg

Link to comment
Share on other sites

Scuze dar mai am doar vreo 2 probleme de rezolvat si termin si vreau sa-mi deschis serverul ... Si nu gasesc bodyweapons nicaieri..

Defapt am gasit un bodyweapons, dar am citit la el ca trebuie COMPILAT cu 0.3E si nush de unde sa iau includes de la 0.3E ...

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.