SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/12/2013, 11:11 AM   #1
Boss201
Big Clucker
 
Join Date: Sep 2013
Posts: 60
Reputation: 1
Default /report cmd

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.
Boss201 is offline   Reply With Quote
Old 04/12/2013, 11:18 AM   #2
gotwarzone
Banned
 
Join Date: Sep 2013
Posts: 512
Reputation: 22
Default Re: /report cmd

Quote:
Originally Posted by Boss201 View Post
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.
Code:
forward SendToAdmins(color,const string[]);

Code:
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;
}
Code:
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;
}
gotwarzone is offline   Reply With Quote
Old 04/12/2013, 11:18 AM   #3
TahaAsif12
Huge Clucker
 
Join Date: Nov 2013
Posts: 269
Reputation: 23
Default Re: /report cmd

Can u show the SendToId function?
__________________
TahaAsif12 is offline   Reply With Quote
Old 04/12/2013, 11:38 AM   #4
Boss201
Big Clucker
 
Join Date: Sep 2013
Posts: 60
Reputation: 1
Default Re: /report cmd

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 (c) 1997-2006, ITB CompuPhase


4 Errors.
line 179= if((PlayerInfo[i][pAdminLevel] >= 1)) SendClientMessage(i, color, string);
Boss201 is offline   Reply With Quote
Old 04/12/2013, 11:45 AM   #5
gotwarzone
Banned
 
Join Date: Sep 2013
Posts: 512
Reputation: 22
Default Re: /report cmd

Can you please show 1 admin command like /slap or /burn
gotwarzone is offline   Reply With Quote
Old 04/12/2013, 11:47 AM   #6
Boss201
Big Clucker
 
Join Date: Sep 2013
Posts: 60
Reputation: 1
Default Re: /report cmd

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;
}
Boss201 is offline   Reply With Quote
Old 04/12/2013, 11:49 AM   #7
gotwarzone
Banned
 
Join Date: Sep 2013
Posts: 512
Reputation: 22
Default Re: /report cmd

Replaced the old one

Code:
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 Code:
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;
}
gotwarzone is offline   Reply With Quote
Old 04/12/2013, 11:56 AM   #8
Boss201
Big Clucker
 
Join Date: Sep 2013
Posts: 60
Reputation: 1
Default Re: /report cmd

thanks its working
Boss201 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Its a Crash report NOT a Bug report, its about Debug haathim Client Support 11 24/09/2013 12:27 PM
/report lewismichaelbbc Scripting Help 0 20/06/2012 06:46 PM
A Better Report System Than /report [id] [reason] SantarioLeone Scripting Help 7 09/10/2011 08:23 PM
Can't /report yourself? Tigerbeast11 Help Archive 3 23/08/2011 02:18 AM
/report - Adding Date and Time when a player does /report ? Castle Help Archive 2 02/04/2009 07:42 AM


All times are GMT. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.