Not displaying whole sentence..
#1

Hello,
i have a (/o)oc command, but i have a problem.
So when i type /o Hello, i see in the chatbox :
(([OOC] [NAME] : ello ))
I just see 'ello' so the first letter don't show up.
Here is the script, i edited 10 times, still i can't
find anything.
Quote:

if(strcmp(cmd, "/o", true) == 0){
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir)) {
SendClientMessage(playerid,COLOR_RED,"USAGE: /o [message]");
return 1;
}
dir = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
print(string);
return 1;
}

Reply
#2

Quote:
Originally Posted by Ihsan_Cingisiz
Hello,
i have a (/o)oc command, but i have a problem.
So when i type /o Hello, i see in the chatbox :
(([OOC] [NAME] : ello ))
I just see 'ello' so the first letter don't show up.
Here is the script, i edited 10 times, still i can't
find anything.
Quote:

if(strcmp(cmd, "/o", true) == 0){
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir)) {
SendClientMessage(playerid,COLOR_RED,"USAGE: /o [message]");
return 1;
}
dir = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
print(string);
return 1;
}

Quick question: Why are you using 256 for a string? SA:MP can only send 128 as a Client Message.
Reply
#3

Change the 4 in strmid line to 3.
Reply
#4

pawn Код:
if(strcmp(cmd, "/o", true) == 0)
    {
        strmid(tmp, cmdtext, 3, strlen(cmdtext));
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_RED,"USAGE: /o [message]");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        print(string);
        return 1;
    }
Reply
#5

Quote:
Originally Posted by MadeMan
pawn Код:
if(strcmp(cmd, "/o", true) == 0)
    {
        strmid(tmp, cmdtext, 3, strlen(cmdtext));
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_RED,"USAGE: /o [message]");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string),"(([OOC] [%s]: %s ))",sendername,tmp);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        print(string);
        return 1;
    }
Thank you very much!
But do you know how i can make /b?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)