Rule Dialog
#1

Hello guys, im making a simple dialog that should show the server rules,
Im hoping that someone would be able to help me out, since it is only showing the last rule.
Some language/grammar corrections would be appreciated very much too.

Код:
CMD:rules(playerid, params[])
{
        new str[524];
        format(str, sizeof(str),"1. Respect the rules, the players and the administrators.");
        format(str, sizeof(str),"2. Misuse of the chat is not allowed this includes spamming, and unnessecary use of capitalization.");
        format(str, sizeof(str),"3. Hacking cheating is not allowed, in any way.");
        format(str, sizeof(str),"4. While playing a LEO class its not allowed to attack innocent players.");
        format(str, sizeof(str),"5. Team killing as LEO is not allowed.");
        format(str, sizeof(str),"6. While playing as a LEO it is not allowed to team with civillians.");
        format(str, sizeof(str),"7. Do not EMP vehicles if there are no wanted players inside.");
        format(str, sizeof(str),"8. Do not quit or pause to avoid anything. You will be jailed for this.");
        format(str, sizeof(str),"9. Park your owned vehicle in a sensible spot, preferably at your house.");
        format(str, sizeof(str),"10. Farming score/xp/money in unacceptable, you will be banned for this.");
        format(str, sizeof(str),"11. Do not drive-by without driver.");
        format(str, sizeof(str),"12. The scam limit is $10,000.");
        format(str, sizeof(str),"13. Do not question administrative actions.");
        format(str, sizeof(str),"14. Bugs should be reported, not abused.");
        format(str, sizeof(str),"15. Account sharing is not allowed, this results in termination of both accounts.");
        format(str, sizeof(str),"These are the basic rules, there are more rules, but they are not listed.\n If you have a question regarding the rules ask an administrator first.");
        format(str, sizeof(str),"These rules may be updated without announcement(s) given.");
        ShowPlayerDialog(playerid, dRULES,DIALOG_STYLE_MSGBOX,"Server Rules",str, "Close","");
        return 1;
}
Reply
#2

Try the following code:

PHP код:
CMD:rules(playeridparams[])
{
        new 
str[524];
        
format(strsizeof(str),"1. Respect the rules, the players and the administrators.");
        
format(strsizeof(str),"%s\n2. Misuse of the chat is not allowed this includes spamming, and unnessecary use of capitalization.",str);
        
format(strsizeof(str),"%s\n3. Hacking cheating is not allowed, in any way.",str);
        
format(strsizeof(str),"%s\n4. While playing a LEO class its not allowed to attack innocent players.",str);
        
format(strsizeof(str),"%s\n5. Team killing as LEO is not allowed.",str);
        
format(strsizeof(str),"%s\n6. While playing as a LEO it is not allowed to team with civillians.",str);
        
format(strsizeof(str),"%s\n7. Do not EMP vehicles if there are no wanted players inside.",str);
        
format(strsizeof(str),"%s\n8. Do not quit or pause to avoid anything. You will be jailed for this.",str);
        
format(strsizeof(str),"%s\n9. Park your owned vehicle in a sensible spot, preferably at your house.",str);
        
format(strsizeof(str),"%s\n10. Farming score/xp/money in unacceptable, you will be banned for this.",str);
        
format(strsizeof(str),"%s\n11. Do not drive-by without driver.",str);
        
format(strsizeof(str),"%s\n12. The scam limit is $10,000.",str);
        
format(strsizeof(str),"%s\n13. Do not question administrative actions.",str);
        
format(strsizeof(str),"%s\n14. Bugs should be reported, not abused.",str);
        
format(strsizeof(str),"%s\n15. Account sharing is not allowed, this results in termination of both accounts.",str);
        
format(strsizeof(str),"%s\nThese are the basic rules, there are more rules, but they are not listed.\n If you have a question regarding the rules ask an administrator first.",str);
        
format(strsizeof(str),"%s\nThese rules may be updated without announcement(s) given.",str);
        
ShowPlayerDialog(playeriddRULES,DIALOG_STYLE_MSGBOX,"Server Rules",str"Close","");
        return 
1;

Reply
#3

Why not use strcat for this job rather than 50 format..?
Reply
#4

I would, but i did not know about this, so if you could please explain how it works, i will use that ofcourse.
Isnt using a query as big as this bad for the optimalization of the server?
Reply
#5

https://sampwiki.blast.hk/wiki/Strcat It's the best option for your purpose.
Reply
#6

PHP код:
CMD:rules(playerid){
    new 
szAREA[1024];
    
szAREA "";
    
strcat(szAREA,"1. Respect the rules, the players and the administrators.\n");
    
strcat(szAREA,"2. Misuse of the chat is not allowed this includes spamming, and unnessecary use of capitalization.\n");
    
strcat(szAREA,"3. Hacking cheating is not allowed, in any way.\n");
    
strcat(szAREA,"4. While playing a LEO class its not allowed to attack innocent players.\n");
    
strcat(szAREA,"5. Team killing as LEO is not allowed.\n");
    
strcat(szAREA,"6. While playing as a LEO it is not allowed to team with civillians.\n");
    
strcat(szAREA,"7. Do not EMP vehicles if there are no wanted players inside.\n");
    
strcat(szAREA,"8. Do not quit or pause to avoid anything. You will be jailed for this.\n");
    
strcat(szAREA,"9. Park your owned vehicle in a sensible spot, preferably at your house.\n");
    
strcat(szAREA,"10. Farming score/xp/money in unacceptable, you will be banned for this.\n");
    
strcat(szAREA,"11. Do not drive-by without driver.\n");
    
strcat(szAREA,"12. The scam limit is $10,000.\n");
    
strcat(szAREA,"13. Do not question administrative actions.\n");
    
strcat(szAREA,"14. Bugs should be reported, not abused.\n");
    
strcat(szAREA,"15. Account sharing is not allowed, this results in termination of both accounts.\n");
    
strcat(szAREA,"These are the basic rules, there are more rules, but they are not listed.\n If you have a question regarding the rules ask an administrator first.\n");
    
strcat(szAREA,"These rules may be updated without announcement(s) given.");

    
ShowPlayerDialog(playeriddRULES,DIALOG_STYLE_MSGBOX,"Server Rules",szAREA,"Close","");
    return 
1;

Reply
#7

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
CMD:rules(playerid){
    new 
szAREA[1024];
    
szAREA "";
    
strcat(szAREA,"1. Respect the rules, the players and the administrators.\n");
    
strcat(szAREA,"2. Misuse of the chat is not allowed this includes spamming, and unnessecary use of capitalization.\n");
    
strcat(szAREA,"3. Hacking cheating is not allowed, in any way.\n");
    
strcat(szAREA,"4. While playing a LEO class its not allowed to attack innocent players.\n");
    
strcat(szAREA,"5. Team killing as LEO is not allowed.\n");
    
strcat(szAREA,"6. While playing as a LEO it is not allowed to team with civillians.\n");
    
strcat(szAREA,"7. Do not EMP vehicles if there are no wanted players inside.\n");
    
strcat(szAREA,"8. Do not quit or pause to avoid anything. You will be jailed for this.\n");
    
strcat(szAREA,"9. Park your owned vehicle in a sensible spot, preferably at your house.\n");
    
strcat(szAREA,"10. Farming score/xp/money in unacceptable, you will be banned for this.\n");
    
strcat(szAREA,"11. Do not drive-by without driver.\n");
    
strcat(szAREA,"12. The scam limit is $10,000.\n");
    
strcat(szAREA,"13. Do not question administrative actions.\n");
    
strcat(szAREA,"14. Bugs should be reported, not abused.\n");
    
strcat(szAREA,"15. Account sharing is not allowed, this results in termination of both accounts.\n");
    
strcat(szAREA,"These are the basic rules, there are more rules, but they are not listed.\n If you have a question regarding the rules ask an administrator first.\n");
    
strcat(szAREA,"These rules may be updated without announcement(s) given.");
    
ShowPlayerDialog(playeriddRULES,DIALOG_STYLE_MSGBOX,"Server Rules",szAREA,"Close","");
    return 
1;

szAREA = ""; This part is actually completly useless, as it'll work with just strcat(szAREA, "Text here..");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)