Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command (
/showthread.php?tid=334035)
Command -
3RoR - 13.04.2012
Can someone make me this command like this: /makeadmin [ID/Name of Player] [AdminLevel] [Admin Password] ?
Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /makeadmin [ID Igraca/Deo Imena] [level(1-1338)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
new adminpanel = PlayerInfo[playerid][pAdminPanel];
if(PlayerInfo[playerid][pAdmin] >= 1337 || (IsPlayerAdmin(playerid)))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(level < 0 || level > 1338) return SendClientMessage(playerid, COLOR_GREY,"* Samo 0-1338!!");
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerNameEx(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf(""COL_RED"|CityBot|{FFFFFF} Admin je %s-u dao odredjeni admin level.", sendername, giveplayer, level);
format(string, sizeof(string), "* Postavljen vam je nivo %d admina | Head Admin: {FFFFFF}%s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Postavili ste %s za nivo Admina {FFFFFF}%d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new randcard = 1000 + random(9999);//minimum 1000 max 9999 //giving one at the start
PlayerInfo[playerid][pAdminPanel] = randcard;
format(string,sizeof(string),"{00C0FF}Vasata Admin Lozinka e: {FFFFFF}%d",adminpanel);
SendClientMessage(playerid,COLOR_WHITE,string);
SacuvajIgraca();
}
}
}
else
{
SendClientMessage(playerid, WHITE, ""COL_RED"|CityBot|{FFFFFF} Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}
the red is the admin panel(when you give admin to set the player random admin password) because y don't like it(y like setting my admin password)
Re: Command -
alking282 - 13.04.2012
man iam have command /makeadmin
but he no have [Admin Password] ?
Re: Command -
ViniBorn - 13.04.2012
pawn Код:
tmp = strtok(cmdtext, idx);
if(!strcmp(YOUR_PASSWORD,tmp))
{
//Command
Re: Command -
alking282 - 13.04.2012
man if you need my command tell me and i will give you cod
Re: Command -
3RoR - 13.04.2012
noooooo
y need thes cmd with admin password
ex
/makeadmin 3RoR 1338 101010(Password)..
Re: Command -
3RoR - 14.04.2012
Bump...