Command 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)
+--- Thread: Command help (
/showthread.php?tid=499852)
Command help -
ChromeMenu - 10.03.2014
I am having problems with a command that I made, when I type it in, I want to be like this when sending it.
Код:
[RP to (NAME)(ID)]*MESSAGE
and when getting it I want it to look like:
Код:
[RP from (NAME)(ID)]*MESSAGE
So here is what I made so far but it doesn't work, so when I do /rp to the person it just says
Код:
[RP from (NAME)(ID)]*
Here is the code.
Код:
command(rp, playerid, params[])
{
new string[128], message[128], id;
if(sscanf(params, "uz", id, message))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /rp [playerid] [message]");
}
else
{
if(IsPlayerConnectedEx(id))
{
if(strlen(message) >= 1)
{
}
else
{
format(string, sizeof(string), "[RP to %s]:*%s ", GetName(id), message);
SendClientMessage(playerid, DARKPINK, string);
format(string, sizeof(string), "[RP from %s(%d)]:*%s ", GetName(playerid), playerid, message);
SendClientMessage(id, DARKPINK, string);
PMsLog(string);
}
}
else
{
{
SendClientMessage(playerid, WHITE, "SYNTAX: /rp [playerid] [message]");
}
}
{
SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
}
}
return 1;
}
Re: Command help -
HenrySunseri - 10.03.2014
Код:
CMD:rp(playerid, params[])
{
new string[128], message[128], id, tostring[128];
if(sscanf(params, "uz", id, message))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /rp [playerid] [message]");
}
else
{
if(IsPlayerConnectedEx(id))
{
if(strlen(message) >= 1)
{
}
else
{
format(tostring, sizeof(tostring), "[RP to %s]:*%s ", GetName(id), message);
SendClientMessage(playerid, -1, tostring);
SendClientMessage(playerid, DARKPINK, string);
format(string, sizeof(string), "[RP from %s(%d)]:*%s ", GetName(playerid), playerid, message);
SendClientMessage(id, DARKPINK, string);
PMsLog(string);
}
}
else
{
{
SendClientMessage(playerid, WHITE, "SYNTAX: /rp [playerid] [message]");
}
}
{
SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
}
}
return 1;
}
try this.
Re: Command help -
ChromeMenu - 10.03.2014
No, it didn't work, it did this
Код:
[00:12:45] [RP to Chrome]:*
[00:12:45]
[00:12:45] [RP from Chrome(0)]:*
[00:12:45] That player is not connected or isn't logged in.
Re: Command help -
Macronix - 10.03.2014
Try this:
Код:
if(sscanf(params, "us[128]", id, message))