Problem with /do command
#1

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;
}


Reply
#2

in your do cmd:

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

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

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


EDIT: the above one said it.
Reply
#4

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;
}
Reply
#5

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
Reply
#6

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/
Reply
#7

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

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.
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)