SA-MP Forums Archive
[Ajuda] Matar fora da area de DM - 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] Matar fora da area de DM (/showthread.php?tid=362811)



Matar fora da area de DM - Arthenry - 25.07.2012

bom nessa funзгo o player mata fora da area de dm e vai preso automaticamente, queria que mostrasse a mensagem pra todos:

pawn Код:
if(dini_Int(file2, "DM") == 1){
for(new i=0; i<MAX_PLAYERS; i++){
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
new plid;
GameTextForPlayer(plid,"~b~PRESO", 5000, 0);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
format(string, sizeof(string), "{2F7AFC} | PRISГO | %s matou %s fora da бrea de DM e foi preso automaticamente!", kname, aname);
SendClientMessage(i, Amarelo, string);
}
}
return 1;
}
Ja tentei usar o SendClientMessageToAll e nгo deu, deu error!


Re: Matar fora da area de DM - UkTaKe - 25.07.2012

Vocк tem que usar a funзгo no OnPlayerDeath.


AW: Matar fora da area de DM - billy the kid - 25.07.2012

pawn Код:
if(dini_Int(file2, "DM") == 1){
for(new i=0; i<MAX_PLAYERS; i++){
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
new plid;
GameTextForPlayer(plid,"~b~PRESO", 5000, 0);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
format(string, sizeof(string), "{2F7AFC} | PRISГO | %s matou %s fora da бrea de DM e foi preso automaticamente!", kname, aname,playerid);
SendClientMessageToAll(-1, string);
}
}
return 1;
}
tenta


Re: Matar fora da area de DM - Arthenry - 25.07.2012

Compilou vou testar!


Re: Matar fora da area de DM - Arthenry - 25.07.2012

dEU CERTO Mas a mensagem fika floodando no chat e vc fika todo lagado tipo sei laaa
ai fika travando e fica apatrecendo PRESO PRESO no meio da tela sem parar


Re: Matar fora da area de DM - UkTaKe - 25.07.2012

Ele vai ficar floodando, pq estб dentro do if...


Re: Matar fora da area de DM - Arthenry - 25.07.2012

e outra qnd eu to na area de DM e mato o meu amigo eu vo preso tbm


AW: Matar fora da area de DM - billy the kid - 25.07.2012

esta assim!
pawn Код:
GameTextForPlayer(plid,"~b~PRESO", 5000, 0);
nao seria assim ?
pawn Код:
GameTextForPlayer(playerid,"~b~PRESO", 5000, 0);



Re: Matar fora da area de DM - F_Cinco - 25.07.2012

pawn Код:
if(dini_Int(file2, "DM") == 1){
new plid;
for(new i; i != MAX_PLAYERS; i++){
if(IsPlayerConnected(plid)) continue;
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
GameTextForPlayer(plid,"~b~PRESO", 5000, 0);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
format(string, sizeof(string), "{2F7AFC} | PRISГO | %s matou %s fora da бrea de DM e foi preso automaticamente!", kname, aname,playerid);
SendClientMessageToAll(-1, string);
}
}
return 1;
}
@Edit - billy
Nгo, pois estб enviando a mensagem para todos do servidor e, nгo apenar para o player.


Re: Matar fora da area de DM - UkTaKe - 25.07.2012

Entгo vocк tem que colocar alguma condiзгo para que quando o player estiver na arena ele nгo entre nesse if.

Exemplo: ArenaDM[playerid] == true;