i need help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: i need help (
/showthread.php?tid=137765)
i need help -
Dragonshade - 30.03.2010
How To Make This An Rcon Command
pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[CMDINFO]: /makeadmin [playerid] [Level]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(level < 0 || level > 6) { SendClientMessage(playerid, COLOR_RED, "[ERROR:] 0-6 = Valid Levels."); return 1; }
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%s has made %s a server admin", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
Adminmsg(string);
format(string, sizeof(string), "%s has made you a server admin level %d, congratulations. Your commands are /admcmds (or /ah, or /acmds)", GetPlayerNameEx(playerid), level, GetPlayerNameEx(giveplayerid));
SendClientMessage(giveplayerid, COLOR_RED, string);
PlayerInfo[giveplayerid][pAdmin] = level;
return 1;
}
}
}
}
Re: i need help -
iLcke - 30.03.2010
Next time post in scripting disscussion.
Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[CMDINFO]: /makeadmin [playerid] [Level]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(level < 0 || level > 6) { SendClientMessage(playerid, COLOR_RED, "[ERROR:] 0-6 = Valid Levels."); return 1; }
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%s has made %s a server admin", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
Adminmsg(string);
format(string, sizeof(string), "%s has made you a server admin level %d, congratulations. Your commands are /admcmds (or /ah, or /acmds)", GetPlayerNameEx(playerid), level, GetPlayerNameEx(giveplayerid));
SendClientMessage(giveplayerid, COLOR_RED, string);
PlayerInfo[giveplayerid][pAdmin] = level;
return 1;
}
}
}
}
Re: i need help -
Dragonshade - 30.03.2010
Okay And Thanks