SA-MP Forums Archive
Problem with my /o 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)
+--- Thread: Problem with my /o Command (/showthread.php?tid=367588)



Problem with my /o Command - CrazyManiac - 10.08.2012

Hello guys. I have a problem with my /o command. When i type /o Hello, it says ''USAGE: /o <TEXT>''. I cant say anything, it keeps saying how i need to use it. Can anyone fix this for me please? I really need it. Here's the Code:

Код:
COMMAND:o(playerid,params[])
{
    new str[128];
    if(sscanf(params,"s[128]",str)) return SendClientMessage(playerid,-1,"USAGE: /o [TEXT]");
    new name[20];
    GetPlayerName(playerid,name,20);
    format(str,sizeof(str),"[OOC CHAT] %s[ID :%d] : %s",name,playerid,str);
    SendClientMessageToAll(-1,str);
    return 1;
}



Re: Problem with my /o Command - [MM]RoXoR[FS] - 10.08.2012

Works fine for me.

Cross check the following


Re: Problem with my /o Command - kaiks - 10.08.2012

Add this to your stocks:
pawn Код:
stock GetPlayersName(playerid)
{
    new playersName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playersName, MAX_PLAYER_NAME);
    for(new i = 0; i < strlen(playersName); i++)
    {
        if(playersName[i] == '_') playersName[i] = ' ';
    }
    return playersName;
}
And this is the cmd:
pawn Код:
CMD:o(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /o [TEXT]");

    new string[126];
    format(string, sizeof(string), "(( %s: %s ))", GetPlayersName(playerid), params);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
}



Re: Problem with my /o Command - CrazyManiac - 10.08.2012

I do not have any stocks, where do i need to put the stock? Under OnGameModeInit?


Re: Problem with my /o Command - dannyk0ed - 10.08.2012

Quote:
Originally Posted by CrazyManiac
Посмотреть сообщение
I do not have any stocks, where do i need to put the stock? Under OnGameModeInit?
Anywhere in your script.


Re: Problem with my /o Command - CrazyManiac - 10.08.2012

Okay, thank you so much guys