08.04.2017, 22:34
galera, eu vi em um server que a pessoa escrevia HACKER e aparecia uma mensagem tipo: viu um hacker? use /report id reason
alguem sabe como faзo para por isso
alguem sabe como faзo para por isso
|
Use a funзгo strfind na callback OnPlayerText pra achar a palavra hacker e aн da um SendClientMessage
https://sampwiki.blast.hk/wiki/Strfind |
|
Use a funзгo strfind na callback OnPlayerText pra achar a palavra hacker e aн da um SendClientMessage
https://sampwiki.blast.hk/wiki/Strfind |
if(strfind("Hacker", "hack", true) != -1) //returns 4, because the start of 'you' (y) is at index 4 in the string
{
SendClientMessageToAll(0xFFFF0000, "VIU UM HACKER? USE /REPORT ID E O MOTIVO.");
}
public OnPlayerText(playerid, text[])
{
if(strfind(text, "hack", true) != -1 || strfind(text, "hack lixo", true) != -1)
{
SendClientMessage(playerid, -1, "viu um hacker? use /report id reason");
}
return 1;
}
|
kkkkk tenta isso
Код:
public OnPlayerText(playerid, text[])
{
if(strfind(text, "hack", true) != -1 || strfind(text, "hack lixo", true) != -1)
{
SendClientMessage(playerid, -1, "viu um hacker? use /report id reason");
}
return 1;
}
|
if(strfind(text, "hack", true) != 1 || strfind(text, "hack lixo", true) != 1)//
{
SendClientMessage(playerid, -1, "viu um hacker? use /report id reason");
return 0;//aqui agora ta certo!
}
|
Desculpa o erro era o return 1; que й = Existe/FingeExistir deixar passar a mensagem
O Certo й return 0; = nгo existe bloquear! ai :http://imgur.com/a/xWFp4 copia esse code aqui, porquк tem outras coisas atualizadas! Код:
if(strfind(text, "hack", true) != 1 || strfind(text, "hack lixo", true) != 1)//
{
SendClientMessage(playerid, -1, "viu um hacker? use /report id reason");
return 0;//aqui agora ta certo!
}
|