HELP me
#1

GUyz how can i turn this command from RCon admin to SCRIPT admin? script admin means /setadmin 1/2/3?


Quote:

if(strcmp(cmdtext, "/g delete", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new g = 0; g <= MAX_GARAGES; g++)
{
new Garage[64];
format(Garage, sizeof(Garage), "/Garages/%d.dini.save", g);
if(dini_Exists(Garage))
{
LoadGarages(g);
if(IsPlayerInRangeOfPoint(playerid, 3.0, GarageInfo[g][ExtX], GarageInfo[g][ExtY], GarageInfo[g][ExtZ]))
{
format(Garage, sizeof(Garage), "/Garages/%d.dini.save", g);
if(dini_Exists(Garage))
{
Delete3DTextLabel(GarageInfo[g][Label]);
DestroyPickup(GarageInfo[g][Pickup]);
DestroyPickup(GarageInfo[g][Pickup]);
DestroyPickup(GarageInfo[g][Pickup]);
dini_Remove(Garage);
SendClientMessage(playerid,COLOR_GREEN,"Garage was successfully deleted!");
}
}
}
}
} else SendClientMessage(playerid, COLOR_ERROR, "You are not a RCON Administrator.");
return 1;
}

Reply
#2

Depends on your admin system.
Post your /setadmin command here
Reply
#3

Yea it depends on your admin system.
Reply
#4

Quote:
Originally Posted by poppingrose
Посмотреть сообщение
CMDetadmin(playerid, params[])
{
new giveplayerid, moneys1, giveplayer[25], playername[25], string[256];
if (adlvl[playerid] < 6 && !IsPlayerAdmin(playerid)) return 0;
if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /setadmin [playerid] [level 1-6]");
if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
if (moneys1 < 0 || moneys1 > 6) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid admin level.");
if (Logged[giveplayerid] == 0) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Player isn't logged in.");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (adlvl[giveplayerid] >= adlvl[playerid] && adlvl[playerid] != 6 && !IsPlayerAdmin(playerid)) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot Make admin %s", giveplayer, "");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (moneys1 == adlvl[giveplayerid])
{
format(string, 64, "%s is already admin level %d.", giveplayer, moneys1);
SendClientMessage2(playerid, COLOR_WHITE, string);
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (moneys1 != 0)
{
dini_IntSet(AddDirFile(dir_userfiles, giveplayer), "adminlevel", moneys1);
dini_IntSet(AddDirFile(dir_datafiles, FILE_ADMINS), giveplayer, moneys1);
}
else
{
dini_Unset(AddDirFile(dir_userfiles, giveplayer), "adminlevel");
dini_Unset(AddDirFile(dir_datafiles, FILE_ADMINS), giveplayer);
}
adlvl[giveplayerid] = moneys1;
format(string, 64, "You have been set as admin level %d.", moneys1);
SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
format(string, 64, "You have set %s as admin level %d.", giveplayer, moneys1);
SendClientMessage2(playerid, COLOR_YELLOW, string);
return 1;
}
HEre you go
Reply
#5

Код:
if(strcmp(cmdtext, "/g delete", true) == 0)
{
if(adlvl[playerid] > 0)
{
for(new g = 0; g <= MAX_GARAGES; g++)
{
new Garage[64];
format(Garage, sizeof(Garage), "/Garages/%d.dini.save", g);
if(dini_Exists(Garage))
{
LoadGarages(g);
if(IsPlayerInRangeOfPoint(playerid, 3.0, GarageInfo[g][ExtX], GarageInfo[g][ExtY], GarageInfo[g][ExtZ]))
{
format(Garage, sizeof(Garage), "/Garages/%d.dini.save", g);
if(dini_Exists(Garage))
{
Delete3DTextLabel(GarageInfo[g][Label]);
DestroyPickup(GarageInfo[g][Pickup]);
DestroyPickup(GarageInfo[g][Pickup]);
DestroyPickup(GarageInfo[g][Pickup]);
dini_Remove(Garage);
SendClientMessage(playerid,COLOR_GREEN,"Garage was successfully deleted!");
}
}
}
}
} else SendClientMessage(playerid, COLOR_ERROR, "You are not a RCON Administrator.");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)