SA-MP Forums Archive
What does this code mean? - 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: What does this code mean? (/showthread.php?tid=147539)



What does this code mean? - Luis- - 12.05.2010

Код:
error 029: invalid expression, assumed zero
- Luis


Re: What dies this code mean? - Faith - 12.05.2010

show the line of the error, and we'll help


Re: What does this code mean? - Luis- - 12.05.2010

Код:
if(!noooc && PlayerInfo[playerid;][pAdmin;] < 1);



Re: What does this code mean? - Luis- - 12.05.2010

Quote:
Originally Posted by Luis_Geramia
Код:
if(!noooc && PlayerInfo[playerid;][pAdmin;] < 1);
Bump?


Re: What does this code mean? - RyDeR` - 12.05.2010

if(!noooc && PlayerInfo[playerid][pAdmin] < 1)
{

}



Re: What does this code mean? - Luis- - 12.05.2010

Quote:
Originally Posted by » RyDeR «
if(!noooc && PlayerInfo[playerid][pAdmin] < 1)
{

}
Still getting the errors?


Re: What does this code mean? - RyDeR` - 12.05.2010

Quote:
Originally Posted by Luis_Geramia
Quote:
Originally Posted by » RyDeR «
if(!noooc && PlayerInfo[playerid][pAdmin] < 1)
{

}
Still getting the errors?
How do you use it?


Re: What does this code mean? - Luis- - 12.05.2010

if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;

if(!noooc && PlayerInfo[playerid][pAdmin] < 1)
{

}

SendClientMessage(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin !");
return 1;

if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
return 1;
}
format(string, sizeof(string), "[OOC] %s: %s " , sendername, result);
OOCOff(COLOR_OOC,string);
printf("%s", string);
}
return 1;
}
if(strcmp(cmd, "/noooc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2 && (!noooc))
{
noooc = 1;
BroadCast(COLOR_GRAD2, " OOC chat channel disabled by an Admin !");
}
else if (PlayerInfo[playerid][pAdmin] >= 2 && (noooc))
{
noooc = 0;
BroadCast(COLOR_GRAD2, " OOC chat channel enabled by an Admin !");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}


Re: What does this code mean? - RyDeR` - 12.05.2010

Should work fine.


Re: What does this code mean? - Killa_ - 12.05.2010

Replace

pawn Код:
if(!noooc && PlayerInfo[playerid][pAdmin] < 1)
{

}
SendClientMessage(playerid, COLOR_GRAD2, "  The OOC channel has been disabled by an Admin !");
return 1;
With

pawn Код:
if(!noooc && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "  The OOC channel has been disabled by an Admin !");