if(PlayerInfo[playerid][dRank] >= blabla)
i use
Код:
if(PlayerInfo[playerid][dRank] >= blabla) learn and second time i can do it by my own if you can +rep give me codes with if(PlayerInfo[playerid][dRank] >= balba) system |
COMMAND:vchat(playerid,params[])
{
if(PlayerInfo[playerid][dRank] >= 1) // Level 1 VIP
{
new text[128];
if(sscanf(params, "s[128]", text))
{
SendClientMessage(playerid, -1,"Usage: /vsay [Message]");
return 1;
}
new string[128];
format(string, sizeof(string), "[VIP]%s: %s", GetName(playerid), text);
SendClientMessageToAll(0xDCDCDCFF,string);
}
else
{
SendClientMessage(playerid, -1,"You are not a VIP member");
}
return 1;
}
CMD:v(playerid, params[])
{
if(PlayerInfo[playerid][pDonateRank] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
{
new string[128];
if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /v(ip chat) [message]");
if(VIPTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", VIPTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(PlayerInfo[playerid][pToggedVIPChat] == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /togvip to re-enable!");
return 1;
}
if(PlayerInfo[playerid][pVMuted] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the VIP chat channel.");
return 1;
}
if(PlayerInfo[playerid][pDonateRank] == 1)
{
format(string, sizeof(string), "** Bronze VIP %s: %s", GetPlayerNameEx(playerid), params);
VIPTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pDonateRank] == 2)
{
format(string, sizeof(string), "** Silver VIP %s: %s", GetPlayerNameEx(playerid), params);
VIPTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pDonateRank] == 3)
{
format(string, sizeof(string), "** Gold VIP %s: %s", GetPlayerNameEx(playerid), params);
VIPTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pDonateRank] == 4)
{
format(string, sizeof(string), "** Platinum VIP %s: %s", GetPlayerNameEx(playerid), params);
VIPTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pDonateRank] == 5)
{
format(string, sizeof(string), "** Diamond VIP %s: %s", GetPlayerNameEx(playerid), params);
}
if(PlayerInfo[playerid][pAdmin] == 2)
{
format(string, sizeof(string), "** Junior Admin %s: %s", GetPlayerNameEx(playerid), params);
}
if(PlayerInfo[playerid][pAdmin] == 3)
{
format(string, sizeof(string), "** General Admin %s: %s", GetPlayerNameEx(playerid), params);
}
if(PlayerInfo[playerid][pAdmin] == 4)
{
format(string, sizeof(string), "** Senior Admin %s: %s", GetPlayerNameEx(playerid), params);
}
if(PlayerInfo[playerid][pAdmin] == 1337)
{
format(string, sizeof(string), "** Head Admin %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 1338)
{
format(string, sizeof(string), "** Server Manager %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 9999)
{
format(string, sizeof(string), "** Elite Admin %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 99998)
{
format(string, sizeof(string), "** Co-Executive Director %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 99999)
{
format(string, sizeof(string), "** Executive Director %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 999995)
{
format(string, sizeof(string), "** Community Manager %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 999998)
{
format(string, sizeof(string), "** Co-Community Director %s: %s", GetPlayerNameEx(playerid), params);
}
else if(PlayerInfo[playerid][pAdmin] == 999999)
{
format(string, sizeof(string), "** Community Director %s: %s", GetPlayerNameEx(playerid), params);
}
if (PlayerInfo[playerid][pDonateRank] >= 1 || PlayerInfo[playerid][pAdmin] >= 2)
{
SendVIPMessage(COLOR_VIP, string);
}
Log("logs/vipchat.log", string);
}
return 1;
}
forward VIPMSG(color,const string[]);
public OnPlayerText(playerid, text[])
{
if(text[0] == '!' && PlayerInfo[playerid][dRank] >= 1)
{
new string[128];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[VIP Chat]%s: %s",string,text[1]);
VIPMSG(0x8FBC8FFF,string);
return 0;
}
return 1;
}
public VIPMSG(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if((IsPlayerNPC(i)) || (!IsPlayerConnected(i))) continue;
if((PlayerInfo[i][dRank] >= 1)) SendClientMessage(i, color, string);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '.' && PlayerInfo[playerid][pLevel] >= 1 || PlayerInfo[playerid][dRank] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"VIP.Chat: %s: %s",string,text[1]);
MessageToVips(COLOR_PINK,string);
return 0;
}
return 1;
}
forward MessageToVips(color,const string[]);
public MessageToVips(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][dRank] >= 1) SendClientMessage(i, color, string);
}
return 1;
}