13.09.2015, 22:14
how to thats command to 2 commands example: /newb /n but just this command /newb help me
CMD:newb(playerid, params[]) {
if(gPlayerLogged[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
if(AntiAdv(playerid, params)) return 1;
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an Admin!");
if(gNewbie[playerid] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "KULLANIM: (/newb)ie [text]");
if(PlayerInfo[playerid][pNMute] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You're muted from the newbie chat channel.");
new
string[128];
if(NewbieTimer[playerid] > 0) {
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 1)
NewbieTimer[playerid] = 45;
if(PlayerInfo[playerid][pHelper] == 1)
format(string, sizeof(string), "** Junior Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 2)
format(string, sizeof(string), "** General Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 3)
format(string, sizeof(string), "** Senior Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 4)
format(string, sizeof(string), "** Head Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] < 1)
format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] >= 2)
if(AdminDuty[playerid] == 1)
format(string, sizeof(string), "** Admin %s: %s", GetPlayerNameEx(playerid), params);
else
format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] == 1)
format(string, sizeof(string), "** Trial Moderator %s: %s", GetPlayerNameEx(playerid), params);
foreach(Player, n) {
if(gNewbie[n] == 0)
SendClientMessageEx(n, COLOR_NEWBIE, string);
}
return 1;
}
CMD:newb(playerid, params[]) {
if(gPlayerLogged[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
if(AntiAdv(playerid, params)) return 1;
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an Admin!");
if(gNewbie[playerid] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "KULLANIM: (/newb)ie [text]");
if(PlayerInfo[playerid][pNMute] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You're muted from the newbie chat channel.");
new
string[128];
if(NewbieTimer[playerid] > 0) {
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 1)
NewbieTimer[playerid] = 45;
if(PlayerInfo[playerid][pHelper] == 1)
format(string, sizeof(string), "** Junior Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 2)
format(string, sizeof(string), "** General Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 3)
format(string, sizeof(string), "** Senior Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pHelper] == 4)
format(string, sizeof(string), "** Head Helper %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] < 1)
format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] >= 2)
if(AdminDuty[playerid] == 1)
format(string, sizeof(string), "** Admin %s: %s", GetPlayerNameEx(playerid), params);
else
format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
else if(PlayerInfo[playerid][pAdmin] == 1)
format(string, sizeof(string), "** Trial Moderator %s: %s", GetPlayerNameEx(playerid), params);
foreach(Player, n) {
if(gNewbie[n] == 0)
SendClientMessageEx(n, COLOR_NEWBIE, string);
}
return 1;
}