SA-MP Forums Archive
[Ajuda] Da Um help aqui? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Da Um help aqui? (/showthread.php?tid=375060)



Da Um help aqui? - maluco88 - 05.09.2012

Tipow esse comando[/CNN NO CASO NO MEU SERVER] faz isso, porйm o server todo ver eu queria saber como deixa pra sу quem tiver perto ver:



Code :


Код:
	if(strcmp(cmd, "/cnn", true) == 0)
	{
 		tmp = strtok(cmdtext, idx);
 		if (!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 9)
  		{
			SendClientMessage(playerid, 0x0000FFAA, "/cnn ~b~ azul ~g~ verde ~y~ amarelo ~p~ rosa [Ex: ~g~ oi (oi verde)]");
 		}
		if(logged[playerid] == 1)
		{
          if(cnn[playerid] == 0)
          {
            if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pORG] >= 1 )
			{
	  			GetPlayerName(playerid, sendername, sizeof(sendername));
                format(striing, sizeof(striing), "~g~%s~b~: ~w~%s", sendername, tmp);
				GameTextForAll(striing, 5000, 3);
				new PlayerName[30];
	 			GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s usou /cnn com a menssagem: %s", PlayerName, tmp);
                return 1;
			}
	 		else
	  		{
				SendClientMessage(playerid, 0xFF8080AA, "Vocк nгo tem permissгo para usar este comando!");
			}
          }
          else
          {
              SendClientMessage(playerid, 0xFF8080AA, "O CNN esta BLOQUEADO.");
          }
        }
		else
		{
		    SendClientMessage(playerid, 0xFF8080AA, "Vocк tem que estar logado para usar este comando!");
		}
        return 1;
	}
qualquer ajuda bem vinda


Re: Da Um help aqui? - .ThePro - 05.09.2012

IsPlayerInRangeOfPoint

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Da Um help aqui? - rafaelnacio - 05.09.2012

normalmente os admins usam o /cnn para o server todo ver...


Re: Da Um help aqui? - Jason` - 05.09.2012

loop + IsPlayerInRangeOfPoint


Re: Da Um help aqui? - maluco88 - 05.09.2012

ALGUEM ME AJUDA A COLOCA ISSO NO CODE?


Re: Da Um help aqui? - brunogysin - 05.09.2012

Deve ser assim
PHP код:
        new Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridXYZ);
        if (
IsPlayerInRangeOfPoint(playerid50.0 YZ)){
                  
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(striingsizeof(striing), "~g~%s~b~: ~w~%s"sendernametmp);
                
GameTextForAll(striing50003);
        { 
em IsPlayerInRangeOfPoint o numero 50.0 e o raio de distancia, Nгo sei si funciona perfeitamente.