SA-MP Forums Archive
[Tutorial] Making a /me /do /shout /b 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Making a /me /do /shout /b command (/showthread.php?tid=470093)

Pages: 1 2


Re: Making a /me /do /shout /b command - Object - 30.05.2014

In your '/do' command You've a small problem there i believe.

Quote:

CMD:do(playerid, params[])
{
new, string[128], action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /do [action]");
return 1;
}
else
{
format(string, sizeof(string), "* %s (( %s ))", action, GetName(playerid));
ProxDetector(30, playerid, string, COLOR_PURPLE);
}
return 1;
}

You should remove that ',' (Comma) after the 'new' if you didn't remove it you'll get these errors

Quote:

D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(337) : error 001: expected token: "-identifier-", but found ","
D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(33 : error 017: undefined symbol "action"
D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(345) : error 017: undefined symbol "string"
D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(345) : error 017: undefined symbol "string"
D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(345) : error 029: invalid expression, assumed zero
D:\Mido & Mohaned\Mohaned\Windows Scripting2\gamemodes\Untitled.pwn(345) : fatal error 107: too many error messages on one line


So the correct 'do' is the following

Quote:

CMD:do(playerid, params[])
{
new string[128], action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /do [action]");
return 1;
}
else
{
format(string, sizeof(string), "* %s (( %s ))", action, GetName(playerid));
ProxDetector(30, playerid, string, COLOR_PURPLE);
}
return 1;
}




Re: Making a /me /do /shout /b command - ZcvDev - 29.01.2015

nice one


Re: Making a /me /do /shout /b command - Blademaster680 - 30.01.2015

Quote:

In your '/do' command You've a small problem there i believe.

Didnt see that . Thanks fixed it


Re: Making a /me /do /shout /b command - ZcvDev - 31.01.2015

nice one