11.10.2011, 07:28
Hey, I need help sending a message to an admin only, I need to know what to do so I can do so, Thanks ahead of time. Whoever helps will get +1 rep.
stock sendtoadmins(playerid)
{
new string[128];
for(new i = 0; < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pAdmin] > 1)
format(string,sizeof(string),"%s");
SendClientMessage(sendtoadmins,COLOR_YELLOW,string);
}
return 1;
}
CMD:agivekp(playerid,params[]){
new string[128],id,amount;
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid,COLOR_GRAY,"You're not on admin duty!");
if(PlayerInfo[playerid][pAdmin] > 2) return SendClientMessage(playerid,COLOR_GRAY,"You're not authorized to use this command!");
if(sscanf(params,"US",id,amount)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /agivekp [id] [amount]");
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GRAY,"Player is not connected!");
else
{
PlayerInfo[playerid][pKillPoints] = amount;
}
format(string,sizeof(string),"%s has just gave %s [%d] killpoints!",GetName(playerid),GetName(id),amount);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
stock SendToAdmins(COLOR,message[])
{
new string[128];
for(new i = 0; < MAX_PLAYERS; i++)
if(PlayerInfo[i][pAdmin] > 1)
{
SendClientMessage(i,COLOR,message);
}
return 0;
}
CMD:agivekp(playerid,params[])
{
new string[128],id,amount;
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid,COLOR_GRAY,"You're not on admin duty!");
if(PlayerInfo[playerid][pAdmin] > 2) return SendClientMessage(playerid,COLOR_GRAY,"You're not authorized to use this command!");
if(sscanf(params,"us",id,amount)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /agivekp [id] [amount]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GRAY,"Player is not connected!");
PlayerInfo[playerid][pKillPoints] = amount;
format(string,sizeof(string),"%s has just gave %s [%i] killpoints!",GetName(playerid),GetName(id),amount);
SendToAdmin(COLOR_YELLOW,string);
return 1;
}
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 029: invalid expression, assumed zero C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : warning 215: expression has no effect C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 001: expected token: ")", but found ";" C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 036: empty statement C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
stock SendToAdmins(COLOR,message[])
{
new string[128];
for(new i = 0; < MAX_PLAYERS; i++)
if(PlayerInfo[i][pAdmin] > 1)
{
SendClientMessage(i,COLOR,message);
}
return 0;
}
stock SendToAdmins(COLOR,message[])//here we set params for this stock, [] means string/message
{
new string[128];
for(new i = 0; < MAX_PLAYERS; i++)//here we created loop
if(PlayerInfo[i][pAdmin] > 1) // we are checking are all players admins
{
SendClientMessage(i,COLOR,message);//for those which are send message from first line in COLOR from first line
}
else return 0; //for everyone else return 0;
}
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 029: invalid expression, assumed zero C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : warning 215: expression has no effect C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 001: expected token: ")", but found ";" C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : error 036: empty statement C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(837) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
stock SendToAdmins(COLOR,message[])//here we set params for this stock, [] means string/message
{
new string[128];
for( new i = 0; i < MAX_PLAYERS; i++ )//here we created loop
if( PlayerInfo[i][pAdmin] > 1 ) // we are checking are all players admins
{
SendClientMessage( i,COLOR,message );//for those which are send message from first line in COLOR from first line
}
else return 0; //for everyone else return 0;
}
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(838) : error 017: undefined symbol "i" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
stock SendToAdmins(COLOR,message[]) { for( new i = 0; i < MAX_PLAYERS; i++ ) if(PlayerInfo[i][pAdmin] < 1) return 0; SendClientMessage(i,COLOR,message);//heres the error.. return 1; }
stock SendToAdmins(COLOR,string[])//here we set params for this stock, [] means string/message { new string[128]; for(new i = 0; < MAX_PLAYERS; i++)//here we created loop if(PlayerInfo[i][pAdmin] > 1) // we are checking are all players admins { SendClientMessage(i,COLOR,string);//for those which are send message from first line in COLOR from first line } else return 0; //for everyone else return 0; }