24.02.2010, 09:21
Almost done. 2 errors left.
pawn Код:
new Readpms[MAX_PLAYERS]; <<< ON TOP OF SCRIPT
pawn Код:
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) {
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,COLOR_RED,"That ID is not online.");
}
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];
if(playerid != id) {
new year, month,day;
getdate(year, month, day);
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "[PM] %s To %s: %s (%d-%d-%d)", pName,iName,gMessage,month,day,year);
PMLog(string);
format(Message,sizeof(Message),"[PM] To %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,COLOR_YELLOW,Message);
format(Message,sizeof(Message),"[PM] From %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
for(new i = 0; i < MAX_PLAYERS; i++)
if(Readpms[i] == 1)
{
format(string, sizeof(string), "[PM] %s To %s: %s", pName,iName,gMessage);
SendClientMessage(i,COLOR_ORANGE,string);
}
printf("PM: %s",Message);
}
else {
SendClientMessage(playerid,COLOR_RED,"You cannot PM yourself");
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/readpm", true) == 0)
{
if(PlayerAdminLevel[playerid] >= 2)
{
if(Readpms[playerid] == 0)
{
Readpms == 1; <<<<< ERROR LINE
format(string, sizeof(string), "[SERVER]: Readpm Able.");
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
Readpms == 0; <<<<< ERROR LINE
format(string, sizeof(string), "[SERVER]: Readpm Disabled.");
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command!");
}
return 1;
}
Код:
C:\Users\Bouke\Desktop\Server\Server 1\gamemodes\lvrcrTEST.pwn(5689) : error 033: array must be indexed (variable "Readpms") C:\Users\Bouke\Desktop\Server\Server 1\gamemodes\lvrcrTEST.pwn(5695) : error 033: array must be indexed (variable "Readpms") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.