SA-MP Forums Archive
/me command - 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: /me command (/showthread.php?tid=615332)



/me command - Rassh - 21.08.2016

I scripted this /me command but it seems it has one error, can anyone fix it up?
Код:
CMD:me(playerid, params[])
{
	if(isnull(params)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX: /me [action]");
	new string[128];
	format(string, sizeof(string), "* %s %s ", GetPlayerName(playerid), params);
	ProxDetector(30.0, playerid, string, 0xFF0000FF);
	return 1;
}
The error below:
C:\Users\homie\Desktop\script\gamemodes\Untitled.p wn(47) : warning 202: number of arguments does not match definition
C:\Users\homie\Desktop\script\gamemodes\Untitled.p wn(47) : warning 202: number of arguments does not match definition
C:\Users\homie\Desktop\script\gamemodes\Untitled.p wn(4 : error 017: undefined symbol "ProxDetector"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: /me command - Shinja - 21.08.2016

are you sure you have ProxDetector already? if yes show it, no? here is it

PHP код:
stock ProxDetector(playeridFloat:max_rangecolorstring[], Float:max_ratio 1.6)
{
    new
        
Float:pos_x,
        
Float:pos_y,
        
Float:pos_z,
        
Float:range,
        
Float:range_ratio,
        
Float:range_with_ratio,
        
clr_rclr_gclr_b,
        
Float:color_rFloat:color_gFloat:color_b;
    if (!
GetPlayerPos(playeridpos_xpos_ypos_z)) {
        return 
0;
    }
    
color_r float(color >> 24 0xFF);
    
color_g float(color >> 16 0xFF);
    
color_b float(color >> 0xFF);
    
range_with_ratio max_range max_ratio;
#if defined foreach
    
foreach (new Player) {
#else
    
for (new GetPlayerPoolSize(); != -1i--) {
#endif
        
if (!IsPlayerStreamedIn(iplayerid)) {
            continue;
        }
        
range GetPlayerDistanceFromPoint(ipos_xpos_ypos_z);
        if (
range max_range) {
            continue;
        }
        
range_ratio = (range_with_ratio range) / range_with_ratio;
        
clr_r floatround(range_ratio color_r);
        
clr_g floatround(range_ratio color_g);
        
clr_b floatround(range_ratio color_b);
        
SendClientMessage(i, (color 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), string);
    }
    
SendClientMessage(playeridcolorstring);
    return 
1;

EDIT: there is another error there, in your usage of GetPlayerName, its not like that if you want it that simple use a stock
PHP код:
stock GetName(playerid)
{
    new 
name[24]; GetPlayerName(playeridname24); return name;

PHP код:
CMD:me(playeridparams[])
{
    if(
isnull(params)) return SendClientMessage(playerid0xFF0000FF"SYNTAX: /me [action]");
    new 
string[128];
    
format(stringsizeof(string), "* %s %s "GetName(playerid), params);
    
ProxDetector(30.0playeridstring0xFF0000FF);
    return 
1;




Re: /me command - Rassh - 21.08.2016

tried the php code you sent and this shows up.
C:\Users\homie\Desktop\script\gamemodes\Untitled.p wn(49) : error 017: undefined symbol "GetName"
C:\Users\homie\Desktop\script\gamemodes\Untitled.p wn(50) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: /me command - Shinja - 21.08.2016

add this somewhere in you script
PHP код:
stock GetName(playerid

    new 
name[24]; GetPlayerName(playeridname24); return name

And again, do you have ProxDetector already?


Re: /me command - WhiteGhost - 21.08.2016

Honestly. ProxDetector is outdated.
Use: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint or even get the distance between the players.


Re: /me command - Rix70 - 21.08.2016

add me on skype i have a perfekt /me filterscript if u would like linus.45


Re: /me command - Luis- - 21.08.2016

Quote:
Originally Posted by Rix70
Посмотреть сообщение
add me on skype i have a perfekt /me filterscript if u would like linus.45
a /me command is literally about 4 lines of code.. Why would you put it in a filterscript?


Re: /me command - NealPeteros - 21.08.2016

This post can help you
https://sampforum.blast.hk/showthread.php?tid=597904