14.02.2007, 20:08
I have no idea why, it doesn\'t seem to do that on my or my friend\'s servers :S Did you get the patched version?
EDIT- You may try changing \'cmd\' to \'cmdtext\' in the first if statement due to the fact you aren\'t tokening any strings or using it in the command!
P.S. Don\'t forget to include the function whilst posting...
EDIT- Be sure that you didn\'t remove or change the names of variables, or else this might
occur.
[code=Changed Say Command]if(strcmp(cmdtext,"/say",true)==0) {
if(Level[playerid] >= 1 && LoggedIn[playerid] == 1) {
if ((strlen(cmdtext) == 3)||(strlen(cmdtext) == 4)) { SendClientMessage(playerid,red, "Syntax: /say <text>"); return 1; }
if ((strlen(cmdtext[5]) >= 2) && (strlen(cmdtext[5]) <= 150)) { format(string,sizeof(string),"(%s) %s",name,cmdtext[5]); SendMessageToAdmins(string); }
else SendClientMessage(playerid,red,"Error: The length of your message must be between 2 and 150!");
} else SendClientMessage(playerid,red,"Error: You must be logged in as administrator level 1+.");
return 1;
}[/code]
[code=Admin Message Sender]public SendMessageToAdmins(text[]) {
for(new i = 0; i < MAX_PLAYERS; i++) {
new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name));
new file[256]; format(file,sizeof(file),"/xadmin/%s.ini",udb_encode(name));
if (LoggedIn[i] == 1 && Registered[i] == 1 && Level[i] >= 1) SendClientMessage(i,cyan,text);
}
return 1;
}[/code]
EDIT- You may try changing \'cmd\' to \'cmdtext\' in the first if statement due to the fact you aren\'t tokening any strings or using it in the command!
P.S. Don\'t forget to include the function whilst posting...
EDIT- Be sure that you didn\'t remove or change the names of variables, or else this might
occur.
[code=Changed Say Command]if(strcmp(cmdtext,"/say",true)==0) {
if(Level[playerid] >= 1 && LoggedIn[playerid] == 1) {
if ((strlen(cmdtext) == 3)||(strlen(cmdtext) == 4)) { SendClientMessage(playerid,red, "Syntax: /say <text>"); return 1; }
if ((strlen(cmdtext[5]) >= 2) && (strlen(cmdtext[5]) <= 150)) { format(string,sizeof(string),"(%s) %s",name,cmdtext[5]); SendMessageToAdmins(string); }
else SendClientMessage(playerid,red,"Error: The length of your message must be between 2 and 150!");
} else SendClientMessage(playerid,red,"Error: You must be logged in as administrator level 1+.");
return 1;
}[/code]
[code=Admin Message Sender]public SendMessageToAdmins(text[]) {
for(new i = 0; i < MAX_PLAYERS; i++) {
new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name));
new file[256]; format(file,sizeof(file),"/xadmin/%s.ini",udb_encode(name));
if (LoggedIn[i] == 1 && Registered[i] == 1 && Level[i] >= 1) SendClientMessage(i,cyan,text);
}
return 1;
}[/code]