Help, 2 errors for the same thing, ADMIN MODE TOO... -
JAMMIEISFTW - 23.05.2012
Here Are The Commands:
pawn Код:
dcmd_admodeon(playerid,params[])
{
#pragma unused params
new name[24];
new string[128];
if(ad[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You are already set to Away.");
return 1;
}
ad[playerid] =1;
GetPlayerName(playerid,name,128);
format(string, sizeof(string), " %s(%d) Is Now On/OffDuty (Away from keyboard)",name,playerid);
SendClientMessageToAllAdmins(COLOR_RED, string);
new setname[16];
format(setname, sizeof(setname), "Administrator");
if(!strlen(name[11]))
{
adtag[playerid] =1;
SetPlayerName(playerid,setname);
}
format(string, sizeof(string), "8[AWAY] %s(%d) is now AFK! (Away from keyboard)",name,playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
SendClientMessage(playerid, COLOR_LIME, "Type /admodeoff when you want to go off admin mode");
return 1; //return value
}
pawn Код:
dcmd_admodeoff(playerid,params[])
{
#pragma unused params
new name[24];
new string[128];
if(ad[playerid] == 0)
{
SendClientMessage(playerid, COLOR_ERROR, "You are not In Admin Mode!.");
return 1;
}
ad[playerid] =0;
GetPlayerName(playerid,name,16);
new pname[16];
GetPlayerName(playerid,pname,16);
strdel(pname, strlen(pname)-5, strlen(pname));
if(adtag[playerid] == 1)
{
adtag[playerid] =0;
SetPlayerName(playerid,pname);
}
new name2[16];
GetPlayerName(playerid,name2,16);
format(string, sizeof(string), "[OFF DUTY] %s(%d) is now off duty",name2,playerid);
SendClientMessageToAllAdmins(COLOR_RED, string);
SendClientMessage(playerid, COLOR_LIME, "Type /admodeon to go on duty again.");
return 1;
}
Here Are The Errors:
Код:
C:\Users\Public\Documents\neww\gamemodes\gmcnr.pwn(17004) : error 035: argument type mismatch (argument 1)
C:\Users\Public\Documents\neww\gamemodes\gmcnr.pwn(17044) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Here Are The Affected Lines:
SendClientMessageToAllAdmins(COLOR_RED, string);
SendClientMessageToAllAdmins(COLOR_RED, string);
Heres the public for SendClientMessageToAllAdmins
pawn Код:
public SendClientMessageToAllAdmins(msg[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(AdminLevel[i] >= 1)
{
SendClientMessage(i,COLOR_ADMIN,msg);
}
}
}
}
Here is The Forward For SendClientMessageToAllAdmins
pawn Код:
forward SendClientMessageToAllAdmins(msg[]);
Re: Help, 2 errors for the same thing, ADMIN MODE TOO... -
Jonny5 - 23.05.2012
change the
pawn Код:
SendClientMessageToAllAdmins(COLOR_RED, string);
to
pawn Код:
SendClientMessageToAllAdmins( string);
or if you want to set the color use something like this
pawn Код:
forward SendClientMessageToAllAdmins(Color,msg[]);
public SendClientMessageToAllAdmins(Color,msg[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(AdminLevel[i] >= 1)
{
SendClientMessage(i,Color,msg);
}
}
}
}
Re: Help, 2 errors for the same thing, ADMIN MODE TOO... -
Niko_boy - 23.05.2012
pawn Код:
public SendClientMessageToAllAdmins(msg[])
Since it is having one argument that is only message you cant do
pawn Код:
SendClientMessageToAllAdmins(COLOR_RED, string); // extra COLOR_RED,
instead do
pawn Код:
SendClientMessageToAllAdmins(string);// remove COLOR_RED
Re: Help, 2 errors for the same thing, ADMIN MODE TOO... -
JAMMIEISFTW - 23.05.2012
Thank You Very Much