SA-MP Forums Archive
Help to work with this strirng - 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: Help to work with this strirng (/showthread.php?tid=658634)



Help to work with this strirng - binnyl - 08.09.2018

I wanna to do a system, but i need some help to work with string:

How to do it:
Код:
new Label[][] = {
    {1000, "Intro", "Complete text description, with examples\nNew lines and everything to explain."},
    {1000, "Intro", "Complete text description, with examples\nNew lines and everything to explain."},
    {1000, "Intro", "Complete text description, with examples\nNew lines and everything to explain."},
    {1000, "Intro", "Complete text description, with examples\nNew lines and everything to explain."},
    {1000, "Intro", "Complete text description, with examples\nNew lines and everything to explain."},
};

CMD:label(playerid) {
	new index = labelStatus[playerid];
	// Intro:
    SendClientMessage(playerid, -1, "Intro is: %s ", ???);
    // Description:
    ShowPlayerDialog(playerid,10000,DIALOG_STYLE_MSGBOX,"INFO:",???,"Ok","");
    // First Value:
    GivePlayerMoneyEx(playerid, ???);
    return 1;
}



Re: Help to work with this strirng - solstice_ - 08.09.2018

Do you want to send random messages or what?


Re: Help to work with this strirng - CodeStyle175 - 08.09.2018

PHP код:
enum LabelEnum{
    
Cash,
    
Title[10],
    
MainBody[200]
};
new 
Label[5][LabelEnum] = {
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
};
CMD:label(playerid) {
    new 
labelStatus[playerid],
        
s[90];
    
format(s,90,"Intro is: %s",Label[i][Title]);
    
SendClientMessage(playerid, -1s);
    
format(s,90,"Intro is: %s",Label[i][MainBody]);
    
SendClientMessage(playerid, -1s);
    
GivePlayerMoneyEx(playeridLabel[i][Cash]);
    return 
1;




Re: Help to work with this strirng - binnyl - 08.09.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
PHP код:
enum LabelEnum{
    
Cash,
    
Title[10],
    
MainBody[200]
};
new 
Label[5][LabelEnum] = {
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
    {
1000"Intro""Complete text description, with examples\nNew lines and everything to explain."},
};
CMD:label(playerid) {
    new 
labelStatus[playerid],
        
s[90];
    
format(s,90,"Intro is: %s",Label[i][Title]);
    
SendClientMessage(playerid, -1s);
    
format(s,90,"Intro is: %s",Label[i][MainBody]);
    
SendClientMessage(playerid, -1s);
    
GivePlayerMoneyEx(playeridLabel[i][Cash]);
    return 
1;

I think that is it...
Thank you +rep