Simple global dcmd command wont work -.-
#1

pawn Код:
dcmd_g(playerid, params[])
{
new string[128];
if(GetPVarInt(playerid, "Logged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
new message;
if(sscanf(params,"s",message)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /g [message]");
format(string, sizeof(string), "[GLOBAL] %s(%d) says: %s", PlayerName(playerid), playerid, message);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
It just keeps sending "CMD: /g [message]"

It's been a while since I used dcmd style, but this should work -.-
Reply
#2

pawn Код:
dcmd_g(playerid, params[])
{
if(GetPVarInt(playerid, "Logged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
if(sscanf(params,"s[128]",params)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /g [message]");
format(params,128, "[GLOBAL] %s(%d) says: %s", PlayerName(playerid), playerid, params);
SendClientMessageToAll(COLOR_WHITE, params);
return 1;
}
Reply
#3

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
dcmd_g(playerid, params[])
{
if(GetPVarInt(playerid, "Logged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
if(sscanf(params,"s[128]",params)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /g [message]");
format(params,128, "[GLOBAL] %s(%d) says: %s", PlayerName(playerid), playerid, params);
SendClientMessageToAll(COLOR_WHITE, params);
return 1;
}
Still sends "CMD: /g [message]" even with something after /g
Reply
#4

Seems like nothing wrong there.
Check this code:
pawn Код:
dcmd_asd(playerid, params[])
{
new int;
if(sscanf(params,"d",int)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /g [message]");
format(params,128, "%d", int);
SendClientMessageToAll(COLOR_WHITE, params);
return 1;
}
Reply
#5

It's not just that command, it's all my commands, it doesn't detect anything after the command.
Reply
#6

Do you have the latest sscanf version?
Reply
#7

Yep, I sure do. sscanf2 for r5
Reply
#8

Have you tried the code I gave? (/asd)
Reply
#9

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Have you tried the code I gave? (/asd)
Yep and it replies with "CMD: /g [message]"
Reply
#10

Wait a second, I just read my VM.
You have that code on your OnPlayerCommandText?
I think you should read this:
https://sampwiki.blast.hk/wiki/Fast_Commands#dcmd
https://sampforum.blast.hk/showthread.php?tid=243191
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)