I have this code.... - 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 have this code.... (
/showthread.php?tid=274407)
I have this code.... -
Alex_Obando - 05.08.2011
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/adm", true) == 0)
{
new name[MAX_PLAYER_NAME];
for( new i=0; i<MAX_PLAYERS; i++ )
{
if( IsPlayerConnected(i) && !IsPlayerNPC(i) )
{
GetPlayerName (i, name, sizeof(name) );
if(!strcmp(name, "Alex_Obando", true)) return
SendClientMessage(playerid, -1, "____|CoD:SaMp Online Administrators|____");
SendClientMessage(playerid, -1, "Alex_Obando (Owner Administrator).");
}
else
{
SendClientMessage(playerid, -1, "No admins Online.");
return 1;
}
}
}
return 1;
}
But how I can add a new administrator like "Jackson" if 2 admins online xD?
pawn Код:
SendClientMessage(playerid, -1, "____|CoD:SaMp Online Administrators|____");
SendClientMessage(playerid, -1, "Alex_Obando (Owner Administrator).");
SendClientMessage(playerid, -1, "Jackson Level 1.");
Re: I have this code.... -
iPLEOMAX - 05.08.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/adm", true) == 0)
{
new nadms, name[MAX_PLAYER_NAME];
SendClientMessage(playerid, -1, "____|CoD:SaMp Online Administrators|____");
for( new i=0; i<MAX_PLAYERS; i++ )
{
if( IsPlayerConnected(i) && !IsPlayerNPC(i) )
{
GetPlayerName (i, name, sizeof(name) );
if(!strcmp(name, "Alex_Obando", false)) {
SendClientMessage(playerid, -1, "Alex_Obando (Owner Administrator).");
nadms++;
}
if(!strcmp(name, "Jackson", false)) {
SendClientMessage(playerid, -1, "Jackson Level 1.");
nadms++;
}
}
}
if(nadms == 0) SendClientMessage(playerid, -1, "No Administrators are online.");
}
return 1;
}
untested, modified in a minute.