Not displaying whole sentence.. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not displaying whole sentence.. (
/showthread.php?tid=151656)
Not displaying whole sentence.. -
Ihsan_Cingisiz - 31.05.2010
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;
}
|
Re: Not displaying whole sentence.. -
(.Aztec); - 31.05.2010
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.
Re: Not displaying whole sentence.. -
ettans - 31.05.2010
Change the 4 in strmid line to 3.
Re: Not displaying whole sentence.. -
MadeMan - 31.05.2010
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;
}
Re: Not displaying whole sentence.. -
Ihsan_Cingisiz - 31.05.2010
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?