OnPlayerText - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText (
/showthread.php?tid=587750)
OnPlayerText -
karemmahmed22 - 02.09.2015
Ok, i made this for admin chat in other gamemode it was working, now its simple showing "@hi" or "@@hi" instead of admin - mod chat
heres code
PHP код:
if (text[0] == '@')
{
if (text[1] == '@')
{
if (GetAdminLevel(playerid) >= LEVEL_MOD || IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME];
new tmpstr[125];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(tmpstr,sizeof(tmpstr),"%s: %s",name,text[2]);
SendMessageToMods(tmpstr);
return 0;
}
}
else if (GetAdminLevel(playerid) >= LEVEL_ADMIN || IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME];
new tmpstr[125];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(tmpstr,sizeof(tmpstr),"%s: %s",name,text[1]);
SendMessageToAdmins(tmpstr);
return 0;
}
return 0;
}
Also i logging in rcon, setting my admin level to 3 but nothing, heres my getadminlevel stock
PHP код:
stock GetAdminLevel(playerid)
{
return PlayerInfo[playerid][pAdmin];
}
In commands it working, but i dk why it doesn't work here :S
Re: OnPlayerText -
karemmahmed22 - 02.09.2015
Okey nevermind, found smth was returning 1 above lolololol