/w, /s,/t
#1

Hello im here again :P i was trying to create /w for whisper, /s for shout, and /t for talk, (like say) and when i go ingame, it shows the usage but it won't show what you typed. for instance...
*me types /w Hey
*Server shows USAGE: /w [text]

Anyone can help? the script is here
pawn Код:
CMD:t(playerid,params[])
{
    if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /t [text]");
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerName(playerid,Nam,sizeof(Nam));
    format(str,sizeof(str),"%s says: %s",Nam, message);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,10, X,Y,Z))
        {
            SCM(i,0x00E6E6FF,str);
        }
    }
    return 1;
}
CMD:s(playerid,params[])
{
        if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /s [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Shouts: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i,20, X,Y,Z))
                {
                    SCM(i,red,str);
                }
        }
        return 1;
}
CMD:w(playerid,params[])
{
        if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /w [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Whispers: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i, 5.0, X,Y,Z))
                {
                    SCM(i,0xFF925EFF,str);
                }
        }
        return 1;
}
Reply
#2

Anyone who can help?
Reply
#3

pawn Код:
if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /t [text]");
Forgot a bracket. But i dont think that affected the other cmds
Reply
#4

didn't fix it :/
Reply
#5

EDIT: nvm
Reply
#6

Why s[128]? Use like [32] or 64 lol
Reply
#7

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
ive never seen
pawn Код:
SCM(i,0x00E6E6FF,str);
Sorry cant help :/
i used SCM as SendClientMessage :P and yes i defined it and everything that's not the problem. im not sure what the problem is :/
Reply
#8

Your sscanf could be old or maybe screwed up, download the latest version.
Reply
#9

pawn Код:
CMD:t(playerid,params[])
{
    new Float:X, Float:Y, Float:Z;
    if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /t [text]");
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerName(playerid,Nam,sizeof(Nam));
    format(str,sizeof(str),"%s says: %s",Nam, message);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,10, X,Y,Z))
        {
            SCM(i,0x00E6E6FF,str);
        }
    }
    return 1;
}
CMD:s(playerid,params[])
{
        new Float:X, Float:Y, Float:Z;
        if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /s [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Shouts: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i,20, X,Y,Z))
                {
                    SCM(i,red,str);
                }
        }
        return 1;
}
CMD:w(playerid,params[])
{
        new Float:X, Float:Y, Float:Z;
        if(sscanf(params,"s[128]",message)) return SCM(playerid,grey,"USAGE: /w [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Whispers: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i, 5.0, X,Y,Z))
                {
                    SCM(i,0xFF925EFF,str);
                }
        }
        return 1;
}
try that
Reply
#10

still don't work :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)