09.09.2018, 10:25
CMDetbt(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][BT] < return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ERROR", "You need to be higher bT Level to use this command", "OK", "Cancel");
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setbt [playerid] [level]")
&&
SendClientMessage(playerid, orange, "Function: Will set the Level of bT of the Specific Player");
new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(isnull(tmp2)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setbt [playerid] [level]")
&&
SendClientMessage(playerid, orange, "Function: Will set the Level of bT of the Specific Player");
level = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
if(PlayerInfo[player1][LoggedIn] == 1) {
if(level > 10 ) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Max bT Level is 10");
if(level == PlayerInfo[player1][BT]) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Player is already this bT level");
CMDMessageToAdmins(playerid,"SetbT");
CMDMessageToBT(playerid,"SetbT");
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);
if(level > 0) format(string,sizeof(string)," %s has set youre bT Status to level %d",adminname, level);
else format(string,sizeof(string)," %s has set youre bT Status to level %d",adminname, level);
SendClientMessage(player1,0x00FFFFAA,string);
if(level > PlayerInfo[player1][BT]) GameTextForPlayer(player1,"~g~bT LEVEL UP", 2000, 3);
else GameTextForPlayer(player1,"~r~bT LEVEL DOWN", 2000, 3);
format(string,sizeof(string),"You have made %s bT Level %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second); SendClientMessage(playerid,0x00FFFFAA,string);
format(string,sizeof(string),"%s has made %s bT Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second);
SaveToFile("btmembers",string);
dUserSetINT(PlayerName2(player1)).("bT",(level));
PlayerInfo[player1][BT] = level;
return PlayerPlaySound(player1,1057,0.0,0.0,0.0);
} else return SendClientMessage(playerid,0xFF0000AA,"ERROR: Player must be registered and logged in to be set as a bT member");
} else return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
} else return SendClientMessage(playerid,0xFF0000AA,"ERROR: You must be logged in to use this commands");
}
forward MessageToBT(color,const string[]);
public MessageToBT(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][BT] >= 1) {
if(PlayerInfo[i][LoggedIn] == 1) {
SendClientMessage(i, color, string); }
}
}
}
CMDMessageToBT(playerid,command[]) {
new string[128];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[bTMember] '%s' (Level: %d) | Command: %s",string,PlayerInfo[playerid][BT],command);
MessageToBT(blue,string);
return 1;
}
So, This IS the command now tell me
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][BT] < return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ERROR", "You need to be higher bT Level to use this command", "OK", "Cancel");
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setbt [playerid] [level]")
&&
SendClientMessage(playerid, orange, "Function: Will set the Level of bT of the Specific Player");
new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(isnull(tmp2)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setbt [playerid] [level]")
&&
SendClientMessage(playerid, orange, "Function: Will set the Level of bT of the Specific Player");
level = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
if(PlayerInfo[player1][LoggedIn] == 1) {
if(level > 10 ) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Max bT Level is 10");
if(level == PlayerInfo[player1][BT]) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Player is already this bT level");
CMDMessageToAdmins(playerid,"SetbT");
CMDMessageToBT(playerid,"SetbT");
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);
if(level > 0) format(string,sizeof(string)," %s has set youre bT Status to level %d",adminname, level);
else format(string,sizeof(string)," %s has set youre bT Status to level %d",adminname, level);
SendClientMessage(player1,0x00FFFFAA,string);
if(level > PlayerInfo[player1][BT]) GameTextForPlayer(player1,"~g~bT LEVEL UP", 2000, 3);
else GameTextForPlayer(player1,"~r~bT LEVEL DOWN", 2000, 3);
format(string,sizeof(string),"You have made %s bT Level %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second); SendClientMessage(playerid,0x00FFFFAA,string);
format(string,sizeof(string),"%s has made %s bT Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second);
SaveToFile("btmembers",string);
dUserSetINT(PlayerName2(player1)).("bT",(level));
PlayerInfo[player1][BT] = level;
return PlayerPlaySound(player1,1057,0.0,0.0,0.0);
} else return SendClientMessage(playerid,0xFF0000AA,"ERROR: Player must be registered and logged in to be set as a bT member");
} else return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
} else return SendClientMessage(playerid,0xFF0000AA,"ERROR: You must be logged in to use this commands");
}
forward MessageToBT(color,const string[]);
public MessageToBT(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][BT] >= 1) {
if(PlayerInfo[i][LoggedIn] == 1) {
SendClientMessage(i, color, string); }
}
}
}
CMDMessageToBT(playerid,command[]) {
new string[128];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[bTMember] '%s' (Level: %d) | Command: %s",string,PlayerInfo[playerid][BT],command);
MessageToBT(blue,string);
return 1;
}
So, This IS the command now tell me