SA-MP Forums Archive
Problem with /do 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: Problem with /do command (/showthread.php?tid=487704)



Problem with /do command - Vasu99 - 14.01.2014

Hi,

Thanks for reading.

In the script I'm trying to edit into my own, two commands were included, which will be listed below. One of them works perfectly, but the other one doesn't. I can use it, but it simply says "*Timothy Blake (( ))", nothing more no matter what I write in the command. I will show you screenshots below, along with the code. Keep in mind that the first command is /me, which works perfectly, and that the second is /do.

Код:
CMD:me(playerid, params[])
{
	new string[256], name[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, name, sizeof(name));
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, 0xE3E3E3, "USAGE: /me [action]");
	format(string, sizeof(string), "* %s %s", name, params);
 	SendNearbyMessage(playerid, 15, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
	return 1;
}

CMD:do(playerid, params[])
{
	new string[256], name[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, name, sizeof(name));
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, 0xE3E3E3, "USAGE: /do [Surroundings]");
	format(string, sizeof(string), "* %s (( %s ))", name);
	SendNearbyMessage(playerid, 15, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
	return 1;
}





Re: Problem with /do command - CutX - 14.01.2014

in your do cmd:

format(string, sizeof(string), "* %s (( %s ))", name,);

there's no message.... youre just using the name here


Re: Problem with /do command - Kirollos - 14.01.2014

pawn Код:
format(string, sizeof(string), "* %s (( %s ))", name);


EDIT: the above one said it.


Respuesta: Problem with /do command - Swedky - 14.01.2014

pawn Код:
CMD:me(playerid, params[])
{
    new string[256], name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", params[0])) return SendClientMessage(playerid, 0xE3E3E3, "USAGE: /me [action]");
    format(string, sizeof(string), "* %s %s", name, params[0]);
    SendNearbyMessage(playerid, 15, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    return 1;
}

CMD:do(playerid, params[])
{
    new string[256], name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", params[0])) return SendClientMessage(playerid, 0xE3E3E3, "USAGE: /do [Surroundings]");
    format(string, sizeof(string), "* %s (( %s ))", name, params[0]);
    SendNearbyMessage(playerid, 15, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    return 1;
}



Re: Problem with /do command - Vasu99 - 14.01.2014

Thanks, I'll try that EnzoMetic. Although,

I've got yet another problem. The color is kind of blue, even though I've scripted it as grey. The define for the grey color is here.

Код:
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_GREY 0xE3E3E3
#define COLOR_RED 0xFF3D3DFF
#define COLOR_LIGHTRED 0xFF6347FF



Re: Problem with /do command - CutX - 14.01.2014

Quote:
Originally Posted by Vasu99
Посмотреть сообщение
Thanks, I'll try that EnzoMetic. Although,

I've got yet another problem. The color is kind of blue, even though I've scripted it as grey. The define for the grey color is here.

Код:
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_GREY 0xE3E3E3
#define COLOR_RED 0xFF3D3DFF
#define COLOR_LIGHTRED 0xFF6347FF
use colorpicker
http://colorpickersamp.codeplex.com/


Respuesta: Problem with /do command - Swedky - 14.01.2014

pawn Код:
#define COLOR_GREY "{C0C0C0}" // Grey color...



Re: Problem with /do command - Vasu99 - 14.01.2014

I'm not sure, @CutX I found that grey color on that website, yet it isn't purple lol. And EnzoMetic, if I add that on define, how do I edit the /do and /me commands? I tried doing it but it gave me errors.


Re: Problem with /do command - ConnorHunter - 14.01.2014

You forgot the transparency thing at the end

pawn Код:
#define COL_WHITE 0xFFFFFFFF
#define COL_RED 0xF81414FF
#define COL_GREEN 0x00FF22FF
#define COL_LIGHTBLUE 0x00CED1FF
#define COLOR_GREY 0xE3E3E3FF
#define COLOR_RED 0xFF3D3DFF
#define COLOR_LIGHTRED 0xFF6347FF



Respuesta: Problem with /do command - Swedky - 14.01.2014

http://www.webtaller.com/utilidades/...er/colores.php

It is in Spanish.

You must pulsate in a color, and in a cabin of below you the color appears in Hexadecimal.