SA-MP Forums Archive
[ASK]how to make command /me? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [ASK]how to make command /me? (/showthread.php?tid=177562)



[ASK]how to make command /me? - lightningcrow - 18.09.2010

i will make command /me, this is script
Код:
[566]dcmd_me(const playerid, message[])
[567]{
[568]    if (!strlen(message)) {
[569]        SendClientMessage(playerid,COLOR_RED,"USAGE : /me [Gerakan Tubuh]");
[570]    }
[571]    else {
[572]        new pname[ MAX_PLAYER_NAME ];
[573]        GetPlayerName( playerid, pname, sizeof( pname ));
[574]        format( pname, sizeof(pname), "* %s %s", pname, message );
[575]	       ProxDetector(30.0, playerid, pname, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
[576]        return 1;
[577]		}
[578]    return 1;
[579]}
but show some error like this:
Quote:

C:\Program Files\Rockstar Games\Mode GTA\Project\gamemodes\grandlarc.pwn(575) : error 004: function "ProxDetector" is not implemented
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

how to fix this problem? can some one help me?


Re: [ASK]how to make command /me? - Voldemort - 18.09.2010

Add this

pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(i)) { return 1; }
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                {
                    SendClientMessage(i, col1, string);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SendClientMessage(i, col2, string);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SendClientMessage(i, col3, string);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SendClientMessage(i, col4, string);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                {
                    SendClientMessage(i, col5, string);
                }
            }
            else
            {
                SendClientMessage(i, col1, string);
            }
        }
    }
    return 1;
}



Re: [ASK]how to make command /me? - Mauzen - 18.09.2010

You took this from godfather or Ravens or so, didnt you?
And you did not copy the ProxDetector function. Search for it in the script or forum and add it to your script.


Re: [ASK]how to make command /me? - lightningcrow - 18.09.2010

Thank's for voldemort i can fix this error with your help..

@Mauzen
yes.. i am take this command from NLRP..
I've been looking for ProxDetector function in Script NLRP.. but I did not find it