PDA

View Full Version : [HELP] /ado and /ame commands


Dannylarz
09/05/2012, 03:30 AM
how to make /ado and /ame commands on sscanf....

ex /ado and /ame :

http://sadpanda.us/images/954109-9CHKMAZ.png


Please help me.. i really need thats for 0.3e...
i`m sorry if this thread on wrong section..

Ballu Miaa
09/05/2012, 04:02 AM
Try this for /ame and /ado

//Add this anywhere in the gm but not in a function.
// Credits to VincentDunn for this small ProxDetector recommended for /me's and /do's.
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
{
SendClientMessage(i,color,string);
}
}
}

COMMAND:ame(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ame <text>");
format(string,sizeof(string),"[AME] %s %s",pname,msg);
ProxDetector(20.0, playerid, string,0x330066AA);
SetPlayerChatBubble(playerid, string, 0x330066AA, 100.0, 10000);
return 1;
}
COMMAND:ado(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ado <text>");
format(string,sizeof(string),"[ADO] %s ((%s))",msg,pname);
ProxDetector(20.0, playerid, string,0x330066AA);
SetPlayerChatBubble(playerid, string, 0x330066AA, 100.0, 10000);
return 1;
}

ReneG
09/05/2012, 04:13 AM
Click the tutorial in my signature, it covers everything roleplay chat related

Dannylarz
09/05/2012, 04:40 AM
EDIT : I got 8 warnings after compile it

C:\Roleplay\gamemodes \RP.pwn(28823) : warning 202: number of
arguments does not match definition C:\
Roleplay\gamemodes\RP.pwn(28823) :
warning 202: number of arguments does not match
definition C:\Roleplay\gamemodes
\RP.pwn(28834) : warning 202: number of arguments does not match definition C:\
Roleplay\gamemodes\RP.pwn(28834) :
warning 202: number of arguments does not match
definition C:\Roleplay\gamemodes
\RP.pwn(28834) : warning 202: number of
arguments does not match definition C:\Roleplay\gamemodes\RP.pwn(28834) :
warning 202: number of arguments does not match
definition Pawn compiler 3.2.3664 Copyright (c)
1997-2006, ITB CompuPhase 8 Warnings.

And this is the line


ProxDetector(20.0, playerid, string,0x330066AA);

Dannylarz
09/05/2012, 08:14 AM
is that warning take effects of the script ?? sorry for my bad english

Ballu Miaa
09/05/2012, 12:52 PM
Add this on the bottom of your script as i said before.

stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
{
SendClientMessage(i,color,string);
}
}
return 1;
}

Dannylarz
10/05/2012, 09:32 AM
C:\Roleplay\gamemodes\RP.pwn(32802) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32802) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32802) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32802) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32812) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32812) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32812) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(32812) : warning 202: number of arguments does not match definition
C:\Roleplay\gamemodes\RP.pwn(82796) : error 025: function heading differs from prototype
C:\Roleplayy\gamemodes\RP.pwn(82797) : error 021: symbol already defined: "ProxDetector"

I add proxdetector at the bottom but error i don't know why?
and 8 warning.
please a full explanation but i very very very need CMD /ame and /ado

Ballu Miaa
10/05/2012, 10:41 AM
Download zcmd by Zeex.Click here. (http://forum.sa-mp.com/showthread.php?t=91354)

Put the zcmd.inc file into your servers/pawn/include folder. Then add this just below #include<a_samp>.
#include<zcmd>

And then compile your script.

Dannylarz
10/05/2012, 11:26 AM
thanks.. its work.. but why /ado like this

http://sadpanda.us/images/956059-3F443Q7.png

i hope it like this


http://a1.sphotos.ak.fbcdn.net/hphotos-ak-ash4/s720x720/398878_399237026766330_100000401095261_1322572_268 169101_n.jpg

Dannylarz
12/05/2012, 03:37 PM
please help me!!!

kikito
17/05/2012, 11:45 AM
Create a textdrawn for it?

Dannylarz
17/05/2012, 12:05 PM
edit : no its not textdraw

Don_Gambino
03/06/2012, 03:46 PM
Lols danil ane Muhammad farhan