SA-MP Forums Archive
SplitText doesnt work + Object doesnt attach - 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: SplitText doesnt work + Object doesnt attach (/showthread.php?tid=273598)



SplitText doesnt work + Object doesnt attach - KfirRP - 02.08.2011

1 -
SplitText (here is the stock
pawn Код:
stock SplitText(Float:Prox, playerid, text[])
{
     new string[256], Length = strlen(text) ;
     if(Length > 135)
     {
          new string2[ 1024 ];
          new string3[ 1024 ];
          //
          strmid(string, text, 0, Length / 2);
          format(string2, sizeof(string2), "%s says: %s ...", GetName(playerid), string);
          ProxDetector(Prox, playerid, string2, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
          strmid(string, text, Length / 2, Length);
          format(string3, sizeof(string3), "... %s", string);
          ProxDetector(Prox, playerid, string3, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
     }
     else
     {
          new string4[ 1024 ];
          format(string4, sizeof(string4), "%s says: %s", GetName(playerid), text);
          ProxDetector(Prox, playerid, string4, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
     }
}
Doesnt work. I mean, it does half of the job, it makes the things of the else{, but does not make a new line.. It just makes it like the normal thing.. Long line and thats it.

2 - I made something of tazer and it gives an object to the player's hand but the problem - No object appears. (1-The index is only used for the tazer, no other objects use this index. 2- I havent update RC5. I am on RC3 files, if it matters)
pawn Код:
if(Tazer[playerid] == 0){ Tazer[playerid] = 1; SetPlayerAttachedObject(playerid, 9, 18642, 6, 0.047253, 0.018269, 0.068153, 172.732482, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);}



Re: SplitText doesnt work + Object doesnt attach - KfirRP - 02.08.2011

Bump


Re: SplitText doesnt work + Object doesnt attach - =WoR=Varth - 03.08.2011

Part of SmartChat:
pawn Код:
if(strlen(chat2) > 80)
                {
                    strmid(chat3,chat2,75,160);
                    strdel(chat2,81,160);
                    CostumFormat(chat4,"%s-",chat2);
                    CostumFormat(chat5,"-%s",chat3);
                    SendClientMessage(i,color3,chat4);
                    SendClientMessage(i,color3,chat5);
                }
                else SendClientMessage(i,color3,chat2);



Re: SplitText doesnt work + Object doesnt attach - KfirRP - 03.08.2011

What should I do with it? and what does the 80 mean? if 80 letters? well. And why shouldnt the SplitText work. I'm pretty sure I wrote more than 135 words.. (I filled a full samp line)


Re: SplitText doesnt work + Object doesnt attach - KfirRP - 03.08.2011

Also, can anybody see whats the problem with the Object??


Re: SplitText doesnt work + Object doesnt attach - KfirRP - 03.08.2011

++BUMP;


Re: SplitText doesnt work + Object doesnt attach - =WoR=Varth - 04.08.2011

pawn Код:
if(strlen(chat2) > 80)//If the chat longer that 80
{
   strmid(string1,Original,75,160);//Copy from word 75 to 160 from Original chat
   strdel(Original,81,160);//Cut Original chat from word 81 to word 160
   CostumFormat(output1,"%s-",string);
   CostumFormat(output2,"-%s",string1);
   SendClientMessage(i,color3,output1);
   SendClientMessage(i,color3,output2);
   }
else SendClientMessage(i,color3,Original);
https://sampwiki.blast.hk/wiki/Strdel
https://sampwiki.blast.hk/wiki/Strmid