SA-MP Forums Archive
2 Lines 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: 2 Lines command. (/showthread.php?tid=427858)



2 Lines command. - orelmanor - 03.04.2013

I need that when I will write a /me command , so if the command is too long the text will be in 2 lines.
Thanks for the helpers

This is my /me Command!
PHP код:
if(strcmp(cmd"/me"true) == 0)
    {
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' ')) {
            
idx++;
        }
        new 
offset idx;
        new 
result[128];
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1))) {
            
result[idx offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx offset] = EOS;
        if(!
strlen(result)) { 
            
SendClientMessage(playerid0xFFFFFFFF" /me [action]");
            return 
1;
        }
        
format(stringsizeof(string), "* %s %s"GetName(playerid), result);
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        return 
1;
    } 



Re: 2 Lines command. - SequenceCuz - 03.04.2013

PHP код:
if(strcmp(cmd"/me"true) == 0
    { 
        new 
mynew[1024];
        new 
length strlen(cmdtext); 
        while ((
idx length) && (cmdtext[idx] <= ' ')) { 
            
idx++; 
        } 
        new 
offset idx
        new 
result[128]; 
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1))) { 
            
result[idx offset] = cmdtext[idx]; 
            
idx++; 
        } 
        
result[idx offset] = EOS
        if(!
strlen(result)) {  
            
SendClientMessage(playerid0xFFFFFFFF" /me [action]"); 
            return 
1
        } 
        
format(mynewsizeof(mynew), "* %s %s"GetName(playerid), result); 
        
ProxDetector(30.0playeridmynewCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
        return 
1
    } 
Try to replace this code man xD


Re: 2 Lines command. - orelmanor - 03.04.2013

Quote:
Originally Posted by SequenceCuz
Посмотреть сообщение
PHP код:
if(strcmp(cmd"/me"true) == 0
    { 
        new 
mynew[1024];
        new 
length strlen(cmdtext); 
        while ((
idx length) && (cmdtext[idx] <= ' ')) { 
            
idx++; 
        } 
        new 
offset idx
        new 
result[128]; 
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1))) { 
            
result[idx offset] = cmdtext[idx]; 
            
idx++; 
        } 
        
result[idx offset] = EOS
        if(!
strlen(result)) {  
            
SendClientMessage(playerid0xFFFFFFFF" /me [action]"); 
            return 
1
        } 
        
format(mynewsizeof(mynew), "* %s %s"GetName(playerid), result); 
        
ProxDetector(30.0playeridmynewCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
        return 
1
    } 
Try to replace this code man xD
Doesnt work....


Re: 2 Lines command. - Konstantinos - 03.04.2013

Split the message.


Re: 2 Lines command. - Nathan_Taylor - 03.04.2013

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Split the message.
Isn't that what he is asking to do? -_-


Re: 2 Lines command. - Konstantinos - 03.04.2013

Quote:
Originally Posted by Nathan_Taylor
Посмотреть сообщение
Isn't that what he is asking to do? -_-
Yep, he can ****** it. I can find results about it.


Re: 2 Lines command. - orelmanor - 03.04.2013

Can someone just to edit my command to be 2 lines?
I really need it , and if someone will do it once I will learn how to do it.
Please


Re: 2 Lines command. - glbracer - 03.04.2013

The answer to your problem is to not use OPCT