Help With Script; - 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: Help With Script; (
/showthread.php?tid=149958)
Help With Script; -
Tnt12340 - 24.05.2010
Mind giving me a hand with this script? It works disabling nametags, but it says "unknown command" at the same time; and i can't enable them.
Help a brother out? <3
Код:
if (strcmp("/togglename", cmdtext, true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, false);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have disabled nametags.");
}
z
else if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, true);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have enabled nametags.");
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You are not a staff member!");
}
return 0;
}
[/cpode]
Re: Help With Script; -
novox - 24.05.2010
pawn Код:
if (!strcmp(cmdtext, "/togglename", true))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, false);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have disabled nametags.");
}
else if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, true);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have enabled nametags.");
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You are not a staff member!");
}
return 1;
}
- or try changing the return in OnPlayerCommandText to 1? (if it's zero, that is.)