Errors, need help. -
nmader - 02.11.2011
Код:
if(strcmp(cmd, "/me", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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: /me [action]");
return 1;
}
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "* Admin %s", result);
}
if(PlayerInfo[playerid][pMaskuse] == 1 && PlayerInfo[playerid][pAdminDuty] == 0)
{
format(string, sizeof(string), "* Stranger %s", result);
}
if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(string, sizeof(string), "* %s %s", sendername, result);
}
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] [/ME] %s: %s",d,m,y,h,mi,s,sendername,giveplayer, result);
ActionLog(string);
}
return 1;
}
So, I have copied this straight out of an exsisting GM, and I am getting the following errors:
Код:
C:\Documents and Settings\nmader\Desktop\Folders\WWIII RP\gamemodes\WWIII-RP2.pwn(615) : error 017: undefined symbol "cmd"
C:\Documents and Settings\nmader\Desktop\Folders\WWIII RP\gamemodes\WWIII-RP2.pwn(619) : error 017: undefined symbol "gPlayerLogged"
C:\Documents and Settings\nmader\Desktop\Folders\WWIII RP\gamemodes\WWIII-RP2.pwn(619) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\nmader\Desktop\Folders\WWIII RP\gamemodes\WWIII-RP2.pwn(619) : error 029: invalid expression, assumed zero
C:\Documents and Settings\nmader\Desktop\Folders\WWIII RP\gamemodes\WWIII-RP2.pwn(619) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
I don't get what exactly I am needing to add to the script, or edit at that matter. Any help will be greatly appreciated, and will most likely receive a +rep.
thanks,
nmader
Re: Errors, need help. -
grand.Theft.Otto - 02.11.2011
This is exactly why you don't copy and paste things from one gm to the other. Your gm doesn't have the defines/variables/etc that the other does have, which will cause errors in your script, like gPlayerLogged for example.
I'm 100% sure you don't have the gPlayerLogged variable, or pAdminDuty or pMaskuse or pMuted variables.
Re: Errors, need help. -
nmader - 02.11.2011
Well, you are correct there, but I have transfered anything that relates to them such as enum's, Forwards, new's, etc etc.
But when I add gPlayerLogged, it still says it is undefined.
Re: Errors, need help. -
grand.Theft.Otto - 02.11.2011
Do you use a different enumeration for player data ?
Like PlayerInfo, Information, pInfo, pData, etc ... ? If so, change them to something like:
PlayerInfo[playerid][LoggedIn], pInfo[playerid][AdminDuty], etc ...