[Tutorial] Making a /me /do /shout /b command
#21

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

Reply
#22

nice one
Reply
#23

Quote:

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

Didnt see that . Thanks fixed it
Reply
#24

nice one
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)