Lang/Mute command help
#1

pawn Код:
#include <a_samp>
#include <ladmin>
forward null(playerid);
new Muted[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/lang", cmdtext))
    {
    if(IsPlayerVipType(playerid,3)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You can not language mute a player!");
    {
    new id[MAX_PLAYERS],str[128];
    if(!strval(cmdtext)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /lang [ID]");
    if(Muted[playerid] == 1) return SendClientMessage(playerid,0xFF0000FF,"Player is already language muted!");
    if(!IsPlayerConnected(id[playerid])) return SendClientMessage(playerid,0xFF0000FF,"Player is not Connected");
    Muted[playerid] = 1;
    format(str,sizeof(str),"You language muted %s, he will get auto unmuted in 3 minutes.",id);
    SendClientMessage(playerid,0xFFFF00FF,str);
    SetTimerEx("null", 180000, false, "i", playerid);
    new name[MAX_PLAYER_NAME], string[44];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has been muted, he needs to wait 3 minutes to get unmuted or an Admin or VIP Member can unmute him.",name);
    SendClientMessageToAll(0xFFFF00FF, string);
    }
    return 1;
 }
    if(!strcmp("/unlang", cmdtext))
    {
    if(IsPlayerVipType(playerid,3)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You can not language mute a player!");
    {
    new id[MAX_PLAYERS],str[128];
    if(!strval(cmdtext)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /unlang [ID]");
    if(Muted[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"Player isn't language muted!");
    if(!IsPlayerConnected(id[playerid])) return SendClientMessage(playerid,0xFF0000FF,"Player is not Connected");
    Muted[playerid] = 0;
    format(str,sizeof(str),"You unmuted %s.",id);
    SendClientMessage(playerid,0xFFFF00FF,str);
    new name[MAX_PLAYER_NAME], string[44];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has been unmuted.",name);
    SendClientMessageToAll(0xFFFF00FF, string);
    }
    return 1;
   }
    return 0;
}
    public OnPlayerText(playerid, text[])
    {
    if(Muted[playerid] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: You are language muted and cannot talk.");
    return 1;
}
    public null(playerid)
    {
    Muted[playerid] = 0;
    new name[MAX_PLAYER_NAME], string[44];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has been auto unmuted.",name);
    SendClientMessageToAll(0xFFFF00FF, string);
    return 1;
}
Even if i set myself VIP Level 3 it still say ERROR: You can not language mute a player!
Reply
#2

It would be nice to see your IsPlayerVipType function and where you set them to VIP.

If you are returning 0 if the level is not true then it should be like
pawn Код:
if(!IsPlayerVipType(playerid,3))
Reply
#3

still not working, when i type /lang it says ERROR: You can not language mute a player, when I do like /lang 0 it says server:unknown command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)