SA-MP Forums Archive
ProxDector Help. - 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: ProxDector Help. (/showthread.php?tid=154181)



ProxDector Help. - Hash [NL-RP] - 12.06.2010

So i wanted to ask how do i add a me when a weapon is scrolled, like

Код:
				format(string, sizeof(string), "* %s takes his bag of his back and takes out a %s.", sendername, gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
But where' do i put this code, thanks in advance


Re: ProxDector Help. - Aleksandar_Zivanovci - 12.06.2010

pawn Код:
if(strcmp(cmd, "/me", true) == 0){
    new text[512], tmp[512], me_name[MAX_PLAYER_NAME];

    tmp = strrest(cmdtext, idx);
    if(!strlen(tmp)){
    SendClientMessage(playerid, COLOR_GREY, "USAGE: /me [text]");
    return 1;
    }
    GetPlayerName(playerid, me_name, sizeof(me_name));
    format(text, sizeof(text), "%s %s", me_name, tmp);
    ProxDetector(10.0, playerid, text, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK);
    return 1;
    }
    if(strcmp(cmd, "/do", true) == 0){
    new text[512], tmp[512], do_name[MAX_PLAYER_NAME];

    tmp = strrest(cmdtext, idx);
    if(!strlen(tmp)){
    SendClientMessage(playerid, COLOR_GREY, "USAGE: /do [text]");
    return 1;
    }
    GetPlayerName(playerid, do_name, sizeof(do_name));
    format(text, sizeof(text), "%s ((%s))", tmp, do_name);
    ProxDetector(10.0, playerid, text, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK);
    return 1;
    }
try this /me


Re: ProxDector Help. - Dark_Kostas - 12.06.2010

Use THIS include and put it inside
pawn Код:
OnPlayerWeaponChange(playerid, newweapon, oldweapon)
Here is an example
pawn Код:
OnPlayerWeaponChange(playerid, newweapon, oldweapon)
{
    new gunname[25];
    new string[128];
    GetWeaponName(newweapon, gunname);//Make it yourself
    format(string, sizeof(string), "* %s takes his bag of his back and takes out a %s.", GetPlayerName(playerid), gunname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}



Re: ProxDector Help. - Hash [NL-RP] - 12.06.2010

Quote:
Originally Posted by Dark_Kostas
Use THIS include and put it inside
pawn Код:
OnPlayerWeaponChange(playerid, newweapon, oldweapon)
Here is an example
pawn Код:
OnPlayerWeaponChange(playerid, newweapon, oldweapon)
{
    new gunname[25];
    new string[128];
    GetWeaponName(newweapon, gunname);//Make it yourself
    format(string, sizeof(string), "* %s takes his bag of his back and takes out a %s.", GetPlayerName(playerid), gunname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
Yup Thanks, Thats the one.