15.06.2010, 05:57
Right, i did some editing, and now i am getting some errors; Mind taking a look and helping me out? I'd appreciate it.
The Errors:
Thanks!
The block of coding with the errors in it are below.
Thanks!
The Errors:
Quote:
C:\Documents and Settings\Eric\Desktop\NH-RP2\NHRP Server\gamemodes\nhrp.pwn(2384 : error 029: invalid expression, assumed zero C:\Documents and Settings\Eric\Desktop\NH-RP2\NHRP Server\gamemodes\nhrp.pwn(24936) : error 029: invalid expression, assumed zero C:\Documents and Settings\Eric\Desktop\NH-RP2\NHRP Server\gamemodes\nhrp.pwn(24936) : error 001: expected token: ";", but found ")" C:\Documents and Settings\Eric\Desktop\NH-RP2\NHRP Server\gamemodes\nhrp.pwn(24936) : error 029: invalid expression, assumed zero |
The block of coding with the errors in it are below.
pawn Код:
//----------------------------------[Staff Chat]-----------------------------------------------
if(strcmp(cmd, "//", true) == 0 || strcmp(cmd, "/staffchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
{
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: (//) [text]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 0)
{
if(PlayerInfo[playerid][pAdmin] == 1) { format(string, sizeof(string), "[STAFF CHAT] (Admin 1) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 2) { format(string, sizeof(string), "[STAFF CHAT] (Admin 2) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 3) { format(string, sizeof(string), "[STAFF CHAT] (Senior Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 4) { format(string, sizeof(string), "[STAFF CHAT] (Lead Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 5) { format(string, sizeof(string), "[STAFF CHAT] (Head Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 6) { format(string, sizeof(string), "[STAFF CHAT] (Owner) %s: %s", sendername, result); }
}
if(PlayerInfo[playerid][pGM] >= 0)
{
if(PlayerInfo[playerid][pGM] == 1) { format(string, sizeof(string), "[STAFF CHAT] (Trial GM) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 2) { format(string, sizeof(string), "[STAFF CHAT] (GM 1) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 3) { format(string, sizeof(string), "[STAFF CHAT] (GM 2) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 4) { format(string, sizeof(string), "[STAFF CHAT] (Senior GM) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 5) { format(string, sizeof(string), "[STAFF CHAT] (Lead GM) %s: %s", sendername, result); }
}
SendClientMessageToAll(COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You are not authorised to do that!");
}
return 1;
}
}
pawn Код:
//----------------------------------[Staff Announcement]-----------------------------------------------
if(strcmp(cmd, "/sann", true) == 0)
{
if(IsPlayerConnected(playerid))
{
{
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: (/sann) [text]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|____________**Staff Announcement**____________|");
if(PlayerInfo[playerid][pAdmin] >= 0)
{
if(PlayerInfo[playerid][pAdmin] == 1) { format(string, sizeof(string), "(Administrator) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 2) { format(string, sizeof(string), "(Administrator) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 3) { format(string, sizeof(string), "(Senior Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 4) { format(string, sizeof(string), "(Lead Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 5) { format(string, sizeof(string), "(Head Admin) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pAdmin] == 6) { format(string, sizeof(string), "(Owner) %s: %s", sendername, result); }
}
if(PlayerInfo[playerid][pGM] >= 3)
{
if(PlayerInfo[playerid][pGM] == 3) { format(string, sizeof(string), "(Game Master) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 4) { format(string, sizeof(string), "(Senior GM) %s: %s", sendername, result); }
else if(PlayerInfo[playerid][pGM] == 5) { format(string, sizeof(string), "(Lead GM) %s: %s", sendername, result); }
}
SendClientMessageToAll(COLOR_OOC2, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You are authorised to do that!");
}
return 1;
}
}