A little problem? - 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: A little problem? (
/showthread.php?tid=267568)
A little problem? -
lawonama - 09.07.2011
When I or another admin writes /makemeadmin and he is logged into Rcon he'll become an admin, I want, if he is already an admin, It will say : You are already an admin. But couldn't find how to make another else and if. Could anyone help me please? Thanks already :P
pawn Код:
if (strcmp("/makemeadmin", cmdtext, true, 6) == 0)
{
if (IsPlayerAdmin(playerid))
{
admin[playerid] = 1;
SendClientMessage(playerid,COLOR_GREEN,"You became an admin!");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You must be logged on in RCON!");
return 1;
}
}
AW: A little problem? -
Nero_3D - 09.07.2011
pawn Код:
if (strcmp("/makemeadmin", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if (admin[playerid] == 1)
{
SendClientMessage(playerid,COLOR_GREEN,"You are already an admin!");
}
else
{
admin[playerid] = 1;
SendClientMessage(playerid,COLOR_GREEN,"You became an admin!");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You must be logged on in RCON!");
}
}