/report cmd
#1

Quote:

CMD:report(playerid,params[])
{
new string[128], id, reason[35];
if(sscanf(params,"us[35]",id,reason)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /report [id] [reason]");
if(id == INVALID_PLAYER_ID)) return SendClientMessage(playerid, COLOR_GRAY, "ERROR: Player is not connected!");
format(string,sizeof(string),"%s has reported %s: %s",GetName(playerid),GetName(id),reason);
SendToAdmins(COLOR_YELLOW,string);
return 1;
}

1 ERROR = Undefined symbol "SendToAdmins"

this is my enum
enum PlayerInfo
{
Pass[129],
pAdminLevel,
VIPlevel,
Money,
Scores,
Kills,
Deaths

}

i asked someone he said make a stock for SendToAdmins

i dont know how to make it can some one help me

thanks.
Reply
#2

Quote:
Originally Posted by Boss201
Посмотреть сообщение
1 ERROR = Undefined symbol "SendToAdmins"

this is my enum
enum PlayerInfo
{
Pass[129],
pAdminLevel,
VIPlevel,
Money,
Scores,
Kills,
Deaths

}

i asked someone he said make a stock for SendToAdmins

i dont know how to make it can some one help me

thanks.
on top of your script or together with the forwards.
Код:
forward SendToAdmins(color,const string[]);
Код:
public SendToAdmins(color,const string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if((IsPlayerNPC(i)) || (!IsPlayerConnected(i))) continue;
		if((PlayerInfo[i][pAdminLevel] >= 1)) SendClientMessage(i, color, string);
	}
	return 1;
}
Код:
CMD:report(playerid,params[])
{
new string[128], id, reason[35];
if(sscanf(params,"us[35]",id,reason)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /report [id] [reason]");
if(id == INVALID_PLAYER_ID)) return SendClientMessage(playerid, COLOR_GRAY, "ERROR: Player is not connected!");
format(string,sizeof(string),"%s has reported %s: %s",GetName(playerid),GetName(id),reason);
SendToAdmins(COLOR_YELLOW,string);
return 1;
}
Reply
#3

Can u show the SendToId function?
Reply
#4

gotwarzone i used your code and i got 4 errors

Quote:

C:\Users\pc\Desktop\Scratch\Scripting Data\gamemodes\Gamemode.pwn(179) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\pc\Desktop\Scratch\Scripting Data\gamemodes\Gamemode.pwn(179) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\Scratch\Scripting Data\gamemodes\Gamemode.pwn(179) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\Scratch\Scripting Data\gamemodes\Gamemode.pwn(179) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

line 179= if((PlayerInfo[i][pAdminLevel] >= 1)) SendClientMessage(i, color, string);
Reply
#5

Can you please show 1 admin command like /slap or /burn
Reply
#6

CMD:aslap(playerid,params[])
{
new targetid,height;
if(pInfo[playerid][pAdminLevel] < 1) return 0;
if(sscanf(params,"uI(10)",targetid,height)) return SendClientMessage(playerid,-1,"USAGE : /slap [id] [height]");
if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player not connected || Invalid Id");
new Floatos[3];
GetPlayerPos(targetid,pos[0],pos[1],pos[2]);
SetPlayerPos(targetid,pos[0],pos[1],pos[2] + height);
new msg[128];
new pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,24);
GetPlayerName(targetid,tName,24);
format(msg,sizeof(msg),"%s(%d) slapped %s(%d)",pName,playerid,tName,targetid);
SendClientMessageToAll(-1,msg);
return 1;
}
Reply
#7

Replaced the old one

Код:
public SendToAdmins(color,const string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if((IsPlayerNPC(i)) || (!IsPlayerConnected(i))) continue;
            if((PlayerInfo[i][pAdminLevel] >= 1)) SendClientMessage(i, color, string);
	}
	return 1;
}
to this

Код HTML:
public SendToAdmins(color,const string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if((IsPlayerNPC(i)) || (!IsPlayerConnected(i))) continue;
            if((pInfo[i][pAdminLevel] >= 1)) SendClientMessage(i, color, string);
	}
	return 1;
}
Reply
#8

thanks its working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)