how to make /me
#1

Hi All This My First Time In This Forum Dont Insult Plz Iam begginer

how to make /me


Quote:

//first you need includes
#include <zcmd>
#include <sscanf2>

About /me

Quote:

CMD:me(playerid,params[])
{
new text, string[123];
if(sscanf(params,"sd",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string,sizeof(string),"*%s %s",pName(playerid),text);
SendClientMessageToAll(0xFF00E1FF,string);
return 1;
}

And Thanks if i helped you +rep
Reply
#2

Quote:
Originally Posted by NourNN
Посмотреть сообщение
Hi All This My First Time In This Forum Dont Insult Plz Iam begginer

how to make /me




About /me




And Thanks if i helped you +rep
First of all this is script help thread, not tutorials thread.

And the problem with your code is .
PHP код:
CMD:me(playerid,params[])
{
    new 
text[128], string[128];
    if(
sscanf(params,"s[128]",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
    
format(string,sizeof(string),"*%s %s",pName(playerid),text);
    
SendClientMessageToAll(0xFF00E1FF,string);
    return 
1;

sscanf must include string size, also there is no need for "d" in it, you are not looking for any intergrers. Also your "text" wasnt set to string size
Reply
#3

Post here for tutorials http://forum.sa-mp.com/forumdisplay.php?f=70
Reply
#4

Код:
CMD:me(playerid,params[])
{
new text, string[123];
if(sscanf(params,"sd",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string, sizeof(string), "%s (%d): %s",pName,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}
try this bro
Reply
#5

Quote:
Originally Posted by CrazyPerry
Посмотреть сообщение
Код:
CMD:me(playerid,params[])
{
new text, string[123];
if(sscanf(params,"sd",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string, sizeof(string), "%s (%d): %s",pName,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}
try this bro
I dont even see that you changed something. Text is still recognized as Int as you havent set the size or anything to it, also parameters in sscanf are SD, what is "d" for? Please, just look at my code which works.
Reply
#6

Quote:
Originally Posted by TheSnaKe
Посмотреть сообщение
-_- That for whome who give tutorial to others. Not for ask -_- World of idiot
Reply
#7

Have a look at this.
Reply
#8

Quote:

CMD:me(playerid,params[])
{
new text, string[123];
if(sscanf(params,"sd",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string, sizeof(string), "%s (%d): %s",pName,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}

try this bro

thank you btw
Reply
#9

This guy just want reps lol.
Reply
#10

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
First of all this is script help thread, not tutorials thread.

And the problem with your code is .
PHP код:
CMD:me(playerid,params[])
{
new 
text[128], string[128];
if(
sscanf(params,"s[128]",text)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string,sizeof(string),"*%s %s",pName(playerid),text);
SendClientMessageToAll(0xFF00E1FF,string);
return 
1;

sscanf must include string size, also there is no need for "d" in it, you are not looking for any intergrers. Also your "text" wasnt set to string size
There's no need for sscanf here.
ZCMD has "params", which is what you write after the command.

You use sscanf to split or change those params.
Since 'params' is a string, you can easlily do this instead:

pawn Код:
if (isnull(params)) return SendClientMessage(playerid,0xEBFF00FF,"USAGE: /me [Text]");
format(string,sizeof(string),"*%s %s", pName(playerid), params);
SendClientMessageToAll(0xFF00E1FF, params);
return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)