SA-MP Forums Archive
[HELP] /ado and /ame commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] /ado and /ame commands (/showthread.php?tid=340928)



[HELP] /ado and /ame commands - Dannylarz - 09.05.2012

how to make /ado and /ame commands on sscanf....

ex /ado and /ame :




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


Re: [HELP] /ado and /ame commands - Ballu Miaa - 09.05.2012

Try this for /ame and /ado
pawn Код:
//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;
    }



Re: [HELP] /ado and /ame commands - ReneG - 09.05.2012

Click the tutorial in my signature, it covers everything roleplay chat related


Re: [HELP] /ado and /ame commands - Dannylarz - 09.05.2012

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 ©
1997-2006, ITB CompuPhase 8 Warnings.
And this is the line

Код:
ProxDetector(20.0, playerid, string,0x330066AA);



Re: [HELP] /ado and /ame commands - Dannylarz - 09.05.2012

is that warning take effects of the script ?? sorry for my bad english


Re: [HELP] /ado and /ame commands - Ballu Miaa - 09.05.2012

Add this on the bottom of your script as i said before.
pawn Код:
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;
}



Re: [HELP] /ado and /ame commands - Dannylarz - 10.05.2012

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


Re: [HELP] /ado and /ame commands - Ballu Miaa - 10.05.2012

Download zcmd by Zeex.Click here.

Put the zcmd.inc file into your servers/pawn/include folder. Then add this just below #include<a_samp>.
pawn Код:
#include<zcmd>
And then compile your script.


Re: [HELP] /ado and /ame commands - Dannylarz - 10.05.2012

thanks.. its work.. but why /ado like this



i hope it like this





Re: [HELP] /ado and /ame commands - Dannylarz - 12.05.2012

please help me!!!