Huge Clucker
Join Date: Jan 2016
Posts: 210
Reputation: 17
|
Re: [HELP] how to fix all this warnings
Try this:
PHP Code:
stock ABroadCast(color,string[],level)
{
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
level = PlayerInfo[i][pAdmin];
SendClientMessage(i, color, string);
}
}
return 1;
}
PHP Code:
CMD:admute(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 3 || PlayerInfo[playerid][pModerator] >= 1)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /admute [playerid/partofname]");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= 1)
{
return SendClientMessage(playerid, COLOR_LIGHTRED, "You not authorized to mute administrators.");
}
if(PlayerInfo[giveplayerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 3)
{
return SendClientMessage(playerid, COLOR_GREY, "You're not authorized to mute helpers.");
}
if(PlayerInfo[giveplayerid][pADMute] == 0)
{
PlayerInfo[giveplayerid][pADMute] = 1;
PlayerInfo[giveplayerid][pADMuteTotal] += 1;
szAdvert[giveplayerid][0] = 0;
format(string, sizeof(string), "StaffCmd: %s was muted from advertising by %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
Log("logs/admin.log", string);
ABroadCast(COLOR_LIGHTRED,string,1);
if(PlayerInfo[giveplayerid][pADMuteTotal] > 6)
{
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: Excessive advertisement mutes", GetPlayerNameEx(giveplayerid),playerip,GetPlayerNameEx(playerid));
Log("logs/ban.log", string);
format(string, sizeof(string), "AdmCmd: %s was banned, reason: Excessive advertisement mutes.", GetPlayerNameEx(giveplayerid));
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pBanned] = 1;
new ip[32];
GetPlayerIp(giveplayerid,ip,sizeof(ip));
AddBan(ip);
Kick(giveplayerid);
}
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "Remember, advertisements may only be used for IC purposes and may not be used for any other purpose, unless stated otherwise by an admin.");
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "If you wish to be unmuted, please use '/report'. Future abuse could result in increased punishment.");
format(string, sizeof(string), "StaffCmd: %s was muted from advertisments by %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
}
else if(PlayerInfo[giveplayerid][pADMute] == 1)
{
if(PlayerInfo[giveplayerid][pJailed] != 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You can't offer someone in jail/prison an unmute!");
//SendClientMessage(giveplayerid, COLOR_LIGHTRED, "Sorry, you can't be unmuted from /ad while you're in jail/prison.");
return 1;
}
else
{
ShowAdMuteFine(giveplayerid);
format(string, sizeof(string), "* %s has offered you an unmute from /ad.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "StaffCmd: %s has offered %s an unmute from advertisments.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
foreach(Player, i)
{
if(PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i, COLOR_YELLOW, string);
}
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not autorized to use this command!");
}
return 1;
}
PHP Code:
CMD:permaban(playerid, params[])
{
return SendClientMessage(playerid, COLOR_GREY, "This command has been disabled.");
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], giveplayerid, reason[64];
if(sscanf(params, "us[64]", giveplayerid, reason))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /permaban [playerid/partofname] [reason]");
return 1;
}
//if(AntiAdv(playerid, params)) return 1;
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin])
{
/*if(AdminDuty[playerid] == 1)
{
new username[MAX_PLAYER_NAME];
GetPVarString(playerid, "TempNameName", username, sizeof(username));
SetPVarInt(playerid, "TempName", 0);
SetPlayerName(playerid, username);
}
format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /permaban a higher admin.", PlayerInfo[playerid][pAdminName]);
ABroadCast(COLOR_YELLOW,string,2);
PlayerInfo[playerid][pBanned] = 3;
new ip[32];
GetPlayerIp(playerid,ip,sizeof(ip));
AddBan(ip);
Kick(playerid);*/
SendClientMessageEx(playerid, COLOR_GREY, "You cannot permaban administrators.");
}
else
{
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
if(AdminDuty[giveplayerid] == 1)
{
new username[MAX_PLAYER_NAME];
GetPVarString(giveplayerid, "TempNameName", username, sizeof(username));
SetPVarInt(giveplayerid, "TempName", 0);
SetPlayerName(giveplayerid, username);
format(string, sizeof(string), "AdmCmd: %s(IP:%s) was permanently banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], playerip, GetPlayerNameEx(playerid), reason);
Log("logs/ban.log", string);
format(string, sizeof(string), "AdmCmd: %s was permanently banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason);
}
else
{
format(string, sizeof(string), "AdmCmd: %s(IP:%s) was permanently banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
Log("logs/ban.log", string);
format(string, sizeof(string), "AdmCmd: %s was permanently banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
}
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pPermaBanned] = 1;
new ip[32];
GetPlayerIp(giveplayerid,ip,sizeof(ip));
AddBan(ip);
Kick(giveplayerid);
}
return 1;
}
}
else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
PHP Code:
CMD:f(playerid, params[]) {
if(gFam[playerid] == 1)
return SendClientMessage(playerid, TEAM_CYAN_COLOR, "You have your family chat disabled; /togfamily!");
new string[128];
if(isnull(params))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: (/f)amily [family chat]"); //if(AntiAdv(playerid, params)) return 1; if(PlayerCuffed[playerid] > 0 || GetPVarInt(playerid, "Injured") == 1)
return SendClientMessage(playerid, COLOR_GREY, "You can't talk over /f while you're cuffed, hospitalized or tazed.");
if(PlayerInfo[playerid][pFaction] >= 1 || PlayerInfo[playerid][pGang] < 255) {
new fam = PlayerInfo[playerid][pGang];
new szRank[64], szDivision[64], szEmployer[64]; GetPlayerFactionInfo(playerid, szRank, szDivision, szEmployer);
if(PlayerInfo[playerid][pFaction] != 4 && PlayerInfo[playerid][pFaction] > 0) { format(string, sizeof(string), "** (( %s %s: %s )) **", szRank, GetPlayerNameEx(playerid), params); SendFamilyMessage(PlayerInfo[playerid][pFaction], TEAM_AZTECAS_COLOR, string);
}
else if(PlayerInfo[playerid][pFaction] == 4)
{
format(string, sizeof(string), "** %s %s %s: %s **", szDivision, szRank, GetPlayerNameEx(playerid), params);
SendFamilyMessage(PlayerInfo[playerid][pFaction], TEAM_AZTECAS_COLOR, string);
}
else if(PlayerInfo[playerid][pGang] < 255) {
new szMessage[128], szRank[64];
switch(PlayerInfo[playerid][pRank])
{
case 1: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank1]);
case 2: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank2]);
case 3: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank3]);
case 4: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank4]);
case 5: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank5]);
case 6: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank6]);
default: format(szRank, sizeof(szRank), "%s", FamilyInfo[PlayerInfo[playerid][pGang]][FamilyRank1]);
}
if(PlayerInfo[playerid][pCrew1] == PlayerInfo[playerid][pGang]) { format(szMessage, sizeof(szMessage), "** (%i) %s %s (%s): %s **", PlayerInfo[playerid][pRank], szRank, GetPlayerNameEx(playerid),FamilyInfo[playerid][FamilyCrewname1], params); }
else if(PlayerInfo[playerid][pCrew2] == PlayerInfo[playerid][pGang]) { format(szMessage, sizeof(szMessage), "** (%i) %s %s (%s): %s **", PlayerInfo[playerid][pRank], szRank, GetPlayerNameEx(playerid),FamilyInfo[playerid][FamilyCrewname2], params); }
else if(PlayerInfo[playerid][pCrew3] == PlayerInfo[playerid][pGang]) { format(szMessage, sizeof(szMessage), "** (%i) %s %s (%s): %s **", PlayerInfo[playerid][pRank], szRank, GetPlayerNameEx(playerid),FamilyInfo[playerid][FamilyCrewname3], params); }
else { format(szMessage, sizeof(szMessage), "** (%i) %s %s: %s **", PlayerInfo[playerid][pRank], szRank, GetPlayerNameEx(playerid), params); } SendNewFamilyMessage(PlayerInfo[playerid][pGang], TEAM_AZTECAS_COLOR, szMessage);
}
return 1;
}
else SendClientMessage(playerid, COLOR_GRAD2, "You're not a part of a Family!");
return 1;
}
PHP Code:
CMD:sethelper(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 3 || IsPlayerAdmin(playerid)) {
new iLevel, iTarget;
if(sscanf(params, "ud", iTarget, iLevel))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sethelper [playerid/partofname] [level]");
if(iLevel <= -1 || iLevel >= 6)
return SendClientMessage(playerid, COLOR_GREY, "Valid helper levels start from 1 and end at 4.");
if(iTarget != INVALID_PLAYER_ID) {
if(iLevel >= 3 && PlayerInfo[playerid][pAdmin] < 5 && PlayerInfo[playerid][pHelper] < 5)
return SendClientMessage(playerid, COLOR_GREY, "Only server management may set that helper status.");
new szMessage[128]; PlayerInfo[iTarget][pHelper] = iLevel;
switch(PlayerInfo[playerid][pHelper])
{
case 3:
{
switch(iLevel)
{
case 0: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Assistant Head Helper %s has removed %s from the helper team.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 1: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Assistant Head Helper %s has made %s a Junior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 2: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Assistant Head Helper %s has made %s a Senior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 3: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s the Assistant Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 4: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s the Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 5: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s Helper Management.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
}
}
case 4:
{
switch(iLevel)
{
case 0: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Head Helper %s has removed %s from the helper team.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 1: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Head Helper %s has made %s a Junior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 2: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Head Helper %s has made %s a Senior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 3: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s the Assistant Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 4: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s the Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 5: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s Helper Management.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
}
}
default:
{
switch(iLevel)
{
case 0: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has removed %s from the helper team.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 1: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s a Junior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 2: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s a Senior Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 3: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s the Assistant Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 4: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s Head Helper.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
case 5: format(szMessage, sizeof(szMessage), "> {33CCFF} HelpCmd: Administrator %s has made %s Helper Management.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
}
}
}
foreach(Player, x)
{
if(PlayerInfo[x][pHelper] >= 1 || PlayerInfo[x][pAdmin] >= 1 || PlayerInfo[x][pModerator] >= 1)
{
SendClientMessage(x, COLOR_YELLOW, szMessage);
}
} /*if(PlayerInfo[iTarget][pAcceptReport] > 0)
PlayerInfo[iTarget][pAcceptReport] = 0;*/ }
else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
}
else SendClientMessage(playerid, COLOR_GRAD1, "You are not autorized to use this commands!");
return 1;
}
__________________
Who asks for the reputation doesn't deserve it, who doesn't ask for it deserves it.
My works:
|
Aucun commentaire:
Enregistrer un commentaire