25.07.2016, 20:51
PHP код:
CMD:makedev(playerid, params[])
{
if(gPlayerLogged{playerid} == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
return 1;
}
new pID, level,str[128];
if(PlayerInfo[playerid][pDeveloper] < 7 && PlayerInfo[playerid][pAdmin] < 99999) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!");
if(PlayerInfo[playerid][pAdmin] >= 99999 || PlayerInfo[playerid][pDeveloper] == 6)
{
if(sscanf(params, "ud", pID, level))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makedev [playerid] [level]");
SendClientMessage(playerid, COLOR_GREY, "Available levels: 1 = Beta Tester, 2 = Mapper, 3 = Server Scripter");
SendClientMessage(playerid, COLOR_GREY, "Available levels: 4 = Senior Mapper, 5 = Head Scripter, 6 = Asst.Development Director 7 = Development Director");
return 1;
}
if(level < 0 || level > 7)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Developer level can not be below 0 or above 7!");
return 1;
}
if(level == 0)
{
PlayerInfo[pID][pDeveloper] = 0;
format(str,sizeof(str),"* %s has revoked your Developer status. You're no longer a Developer.", GetPlayerNameEx(playerid));
SendClientMessage(pID, COLOR_LIGHTBLUE, str);
format(str,sizeof(str),"* You've revoked %s's Developer status.", GetPlayerNameEx(pID));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
format(str,sizeof(str),"ADMCMD: %s has revoked %s's Developer status.", GetPlayerNameEx(playerid), GetPlayerNameEx(pID));
SendClientMessageToDevelopers(COLOR_LIGHTRED, str);
}
else
{
new rtext[32];
if(level == 1) { format(rtext,sizeof(rtext),"Beta Tester"); }
if(level == 2) { format(rtext,sizeof(rtext),"Mapper"); }
if(level == 3) { format(rtext,sizeof(rtext),"Server Scripter"); }
if(level == 4) { format(rtext,sizeof(rtext),"Senior Mapper"); }
if(level == 5) { format(rtext,sizeof(rtext),"Head Scripter"); }
if(level == 6) { format(rtext,sizeof(rtext),"Asst.Development Director"); }
if(level == 7) { format(rtext,sizeof(rtext),"Development Director"); }
PlayerInfo[pID][pDeveloper] = level;
format(str,sizeof(str),"* You've made %s a %s.", GetPlayerNameEx(pID), rtext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
format(str,sizeof(str),"* Admin %s has made you a %s.", GetPlayerNameEx(playerid), rtext);
SendClientMessage(pID, COLOR_LIGHTBLUE, str);
format(str,sizeof(str),"ADMCMD: %s has made %s a %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), rtext);
SendClientMessageToDevelopers(COLOR_LIGHTRED, str);
}
}
return 1;
}
CMD:dev(playerid, params[])
{
new chat[100];
if(PlayerInfo[playerid][pDeveloper] < 1) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
if(sscanf(params,"s[100]", chat)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dev [chat]");
{
new rtext[200];
if(PlayerInfo[playerid][pDeveloper] == 1) { format(rtext,sizeof(rtext)," ** Beta Tester %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 2) { format(rtext,sizeof(rtext)," ** Mapper %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 3) { format(rtext,sizeof(rtext)," ** Server Scripter %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 4) { format(rtext,sizeof(rtext)," ** Senior Mapper %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 5) { format(rtext,sizeof(rtext)," ** Head Scripter %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 6) { format(rtext,sizeof(rtext)," ** Asst.Development Director %s: %s", GetPlayerNameEx(playerid), chat); }
if(PlayerInfo[playerid][pDeveloper] == 7) { format(rtext,sizeof(rtext)," ** Development Director %s: %s", GetPlayerNameEx(playerid), chat); }
SendClientMessageToDevelopers(COLOR_DEV, rtext);
}
return 1;
}
CMD:getcoords(playerid)
{
if(PlayerInfo[playerid][pDeveloper] < 1) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
{
new Float:x, Float:y, Float:z, Float:a, str[128];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SendClientMessage(playerid, COLOR_WHITE, "====== Listing your coords.. ======");
format(str,sizeof(str),"X: %f", x);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Y: %f", y);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"X: %f", z);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Facing Angle: %f", a);
SendClientMessage(playerid, COLOR_WHITE, str);
SendClientMessage(playerid, COLOR_WHITE, "===================================");
}
return 1;
}
CMD:getvehinfo(playerid, params[])
{
new carid;
if(PlayerInfo[playerid][pDeveloper] < 1) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
if(sscanf(params,"d", carid))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /getvehinfo [carid]");
SendClientMessage(playerid, COLOR_GREY, "TIP: use /dl to see the vehicle ID.");
return 1;
}
new Float:x, Float:y, Float:z, Float:a, str[128], carname[50];
new model = GetVehicleModel(carid);
format(carname,sizeof(carname),"%s", GetVehicleName(carid));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
SendClientMessage(playerid, COLOR_WHITE, "========== Listing vehicle info.. ==========");
format(str,sizeof(str),"Vehicle ID: %d", carid);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle Model: %d", model);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle Name: %s", carname);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle X: %f", x);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle Y: %f", y);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle X: %f", z);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Vehicle Facing Angle: %f", a);
SendClientMessage(playerid, COLOR_WHITE, str);
SendClientMessage(playerid, COLOR_WHITE, "============================================");
return 1;
}