CMD:admin(playerid, params[], params2, params3, params4)
{
if(LoggedIn[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(strcmp(params, "fine", true) == 0)
{
new targetid,
price,
reason[32];
if(sscanf(params, "uds[32]", targetid, price, reason))
{
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] /Admin Fine Playerid Price Reason.");
}
new
VBString[128],
Admin[MAX_PLAYER_NAME],
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Admin, MAX_PLAYER_NAME);
GetPlayerName(targetid, Name, MAX_PLAYER_NAME);
format(VBString, 128, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just fined %s for %i$ Reason: %s",Admin, Name, price, reason);
SendClientMessageToAll(-1,VBString);
GivePlayerMoney(targetid, -price);
}
else if(strcmp(params, "jail", true) == 0)
{
new pId, time;
if(sscanf(params, "dds", pId, time, params[4]))
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [ID] [time in minuets][reason]");
}
else if(!IsPlayerConnected(pId))
{
SendClientMessage(playerid, 0xFF0000AA, "The ID You Entered Was Not Found.");
}
else
{
new pname[MAX_PLAYER_NAME], jname[MAX_PLAYER_NAME], string1[250];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(pId, jname, sizeof(jname));
format(string1, sizeof(string1), ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just jailed %s for %d seconds, Reason: %s", pname, jname, time, params[4]);
SendClientMessageToAll(0xFF0000AA, string1);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = time;
format(PlayerInfo[playerid][pJailBy], 128, pname);
format(PlayerInfo[playerid][pJailReason], 128, params[4]);
ResetPlayerWeapons(playerid);
return 1;
}
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
new name[MAX_PLAYER_NAME], string[62+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just attempted to use the command: /admin.", name);
SendClientMessage(i, -1, string);
}
}
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not authorized to use this command!");
}
}
else
{
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not logged in!");
}
return 1;
}
public OnGameModeInit() { SetGameModeText("LAD-RP V1.0"); skinlist = LoadModelSelectionMenu("skins.txt"); Create3DTextLabel("Welcome to Los Angeles Deathless Roleplay!\r\nUse the command /tutorial to watch the tutorial!", 0x0000000, 2695.6646, -1704.6169, 11.8438, 40.0, 0, 1); return 1; }
public OnGameModeInit() { SetGameModeText("LAD-RP V1.0"); skinlist = LoadModelSelectionMenu("skins.txt"); Create3DTextLabel("Welcome to Los Angeles Deathless Roleplay!{FF0000}\nUse the command /tutorial to watch the tutorial!", 0x00FF00FF,2695.6646, -1704.6169, 11.8438, 40.0, 0, 1); return 1; }
Create3DTextLabel("Welcome to Los Angeles Deathless Roleplay!\nUse the command /tutorial to watch the tutorial!", 0x0000000, 2695.6646, -1704.6169, 11.8438, 40.0, 0, 1);
Thanks both of you, Plus rep to each one even though @TwinkiDaBoss didn't work.
|
You're welcome, tell me if got any problems again or post on here
|
CMD:admin(playerid, params[])
{
if(LoggedIn[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
new name[MAX_PLAYER_NAME], string[62+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just attempted to use the command: /admin.", name);
SendClientMessage(i, -1, string);
}
}
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not authorized to use this command!");
}
}
else
{
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not logged in!");
}
return 1;
}
PERINTAH:set(playerid, params[]) { if(playerData[playerid][playerLoggedIn]) { if(IsPlayerAdmin(playerid)) { new otherID, otherName[24], message[128], selection[5], amount, message2[128]; if(sscanf(params, "us[20] i", otherID, selection, amount)) { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}Usage: \"set <player> <score/money> <amount>\""); } else { if(IsPlayerConnected(otherID)) { if(playerData[otherID][playerLoggedIn]) { GetPlayerName(otherID, otherName, sizeof(otherName)); if(!strcmp(selection, "score", true)) { playerData[otherID][playerScore] = amount; SetPlayerScore(otherID, playerData[otherID][playerScore]); format(message, sizeof(message), "{B7B7B7}[RCON] {FFFFFF}You set {FFDC2E}%s's {FFFFFF}score to {FFDC2E}%i", otherName, amount); SendClientMessage(playerid, COLOR_WHITE, message); format(message2, sizeof(message), "{B7B7B7}[INFO] {FFFFFF}Your score has been set to {FFDC2E}%i", amount); SendClientMessage(otherID, COLOR_WHITE, message2); if (playerData[playerid][playerLevel] != 7) { new log[250]; format(log, sizeof(log), "%s(%i) set %s(%i)'s score to %i", playerData[playerid][tempAdminName], playerid, otherName, otherID, amount); SendAdminText(playerid, log); } } else if(!strcmp(selection, "money", true)) { playerSetMoney(otherID, amount); format(message, sizeof(message), "{B7B7B7}[RCON] {FFFFFF}You set {FFDC2E}%s's {FFFFFF}money to {FFDC2E}$%s", otherName, FormatNumber(amount)); SendClientMessage(playerid, COLOR_WHITE, message); format(message2, sizeof(message), "{B7B7B7}[INFO] {FFFFFF}Your money has been set to {FFDC2E}$%s", FormatNumber(amount)); SendClientMessage(otherID, COLOR_WHITE, message2); if (playerData[playerid][playerLevel] != 7) { new log[250]; format(log, sizeof(log), "%s(%i) set %s(%i)'s money to %s", playerData[playerid][tempAdminName], playerid, otherName, otherID, FormatNumber(amount)); SendAdminText(playerid, log); } } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not logged in!"); } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not online!"); } } } else { return 0; } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands."); } return 1; }
CMD:admin(playerid, params[], params2, params3, params4)
{
if(LoggedIn[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(strcmp(params, "fine", true) == 0)
{
new targetid,
price,
reason[32];
if(sscanf(params, "uds[32]", targetid, price, reason))
{
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] /Admin Fine Playerid Price Reason.");
}
new
VBString[128],
Admin[MAX_PLAYER_NAME],
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Admin, MAX_PLAYER_NAME);
GetPlayerName(targetid, Name, MAX_PLAYER_NAME);
format(VBString, 128, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just fined %s for %i$ Reason: %s",Admin, Name, price, reason);
SendClientMessageToAll(-1,VBString);
GivePlayerMoney(targetid, -price);
}
else if(strcmp(params, "jail", true) == 0)
{
new pId, time;
if(sscanf(params, "dds", pId, time, params[4]))
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [ID] [time in minuets][reason]");
}
else if(!IsPlayerConnected(pId))
{
SendClientMessage(playerid, 0xFF0000AA, "The ID You Entered Was Not Found.");
}
else
{
new pname[MAX_PLAYER_NAME], jname[MAX_PLAYER_NAME], string1[250];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(pId, jname, sizeof(jname));
format(string1, sizeof(string1), ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just jailed %s for %d seconds, Reason: %s", pname, jname, time, params[4]);
SendClientMessageToAll(0xFF0000AA, string1);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = time;
format(PlayerInfo[playerid][pJailBy], 128, pname);
format(PlayerInfo[playerid][pJailReason], 128, params[4]);
ResetPlayerWeapons(playerid);
return 1;
}
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
new name[MAX_PLAYER_NAME], string[62+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ""Dialog_Color_LightBlue"["Dialog_Color_Red"Admin Warning"Dialog_Color_LightBlue"] %s just attempted to use the command: /admin.", name);
SendClientMessage(i, -1, string);
}
}
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not authorized to use this command!");
}
}
else
{
SendClientMessage(playerid, -1, ""Dialog_Color_LightBlue"["Dialog_Color_Red"Error"Dialog_Color_LightBlue"] You're not logged in!");
}
return 1;
}