[GameMode] Freeroam/Stunt/DM v.1.0
#7

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
It seems like a good gamemode to start off with, but if you're willing to improve it, you could:
  • Change loops that use MAX_PLAYERS for loops that use GetPlayerPoolSize.
  • Save the player's name in a variable, and use it instead of retrieving the player's name with the native function over and over again.
  • pawn Код:
    if(sscanf(params, "s[250]", string))
    Input is restricted to 128 characters. 250?
  • pawn Код:
    new string2[250];
    format(string2, sizeof(string2), "{D526D9}[WHISPER] {FFFFFF}%s(%i): %s", name, playerid, string);
    Output is restricted to 144. 250?
  • Use booleans instead of just using 0 and 1 on integers.
  • pawn Код:
    format(string, sizeof(string), "{F5F111}Level 1 Donor [$5.00 USD]\n\n", string);
    format(string, sizeof(string), "%s{FFFFFF}- Receive 500,000 in-game cash.\n", string);
    format(string, sizeof(string), "%s{FFFFFF}- Get a custom VIP tag.\n", string);
    That is a very slow method, it appends the string previously appended and formats the "new" string. Use format + strcat, it's much faster (tests have been made).
  • pawn Код:
    if(playerid == id) return SendClientMessage(playerid, COLOR_WHITE, "{FC3003}[ERROR]{FFFFFF} You can't send a PM to yourself!");
        {
            GetPlayerName(playerid, Name1, sizeof(Name1));
            GetPlayerName(id, Name2, sizeof(Name2));
            format(str, sizeof(str), "{FC9D03}[PM]{FFFFFF} to {FC9D03}%s(%d){FFFFFF}: %s", Name2, id, str2);
            SendClientMessage(playerid, COLOR_WHITE, str);
            format(str, sizeof(str), "{FC9D03}[PM]{FFFFFF} from {FC9D03}%s(%d){FFFFFF}: %s", Name1, playerid, str2);
            SendClientMessage(id, COLOR_WHITE, str);
        }
    What's up with those curly braces?
  • pawn Код:
    new str[400], str2[400]
    You're using variables with a lot of cells for outputs restricted to 144 characters, consider reducing the amount of cells used to 144. Note that to format "Hello %s!" and store it in a 144 cell variable isn't the same as storing it into a 400 cell variable. It takes longer on the 400 cell variable (tests have been made).
  • It isn't necessary to add a bunch of returns everywhere on OnDialogResponse.
I could probably go on and on, but I guess that's enough for the moment.

Good job, and if you would like to improve this gamemode a bit, but not in obligation, you can take in note my observations and possible improvements.

Good job, though! +6 rep
I will try to improve it like you said.Thanks again
Reply


Messages In This Thread
Freeroam/Stunt/DM v.1.0 [Stopped] || Minor updates added "9.8.2016" - by Quinncell - 20.07.2016, 18:22
Re: Freeroam/Stunt/DM v.1.0 - by Bolex_ - 20.07.2016, 18:30
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 20.07.2016, 18:36
Re: Freeroam/Stunt/DM v.1.0 - by SickAttack - 20.07.2016, 18:59
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 20.07.2016, 19:05
Re: Freeroam/Stunt/DM v.1.0 - by SickAttack - 20.07.2016, 23:02
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 20.07.2016, 23:15
Re: Freeroam/Stunt/DM v.1.0 - by cuddlee - 21.07.2016, 05:48
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 21.07.2016, 10:30
Re: Freeroam/Stunt/DM v.1.0 - by GuepardHD - 01.08.2016, 20:19
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 01.08.2016, 23:33
Re: Freeroam/Stunt/DM v.1.0 - by Quinncell - 08.09.2016, 16:38
Re: Freeroam/Stunt/DM v.1.0 - by markparker12 - 08.09.2016, 17:19
Re: Freeroam/Stunt/DM v.1.0 - by HoNEYKISS - 07.09.2017, 11:23
Re: Freeroam/Stunt/DM v.1.0 - by metelicgamer - 14.09.2017, 16:53
Re: Freeroam/Stunt/DM v.1.0 - by OmerKhan - 14.09.2017, 17:04
Re: Freeroam/Stunt/DM v.1.0 - by wisnuken - 02.12.2017, 15:54
Re: Freeroam/Stunt/DM v.1.0 - by wisnuken - 02.12.2017, 16:00
Re: Freeroam/Stunt/DM v.1.0 - by Bolex_ - 02.12.2017, 16:04
Re: Freeroam/Stunt/DM v.1.0 - by wisnuken - 02.12.2017, 16:09

Forum Jump:


Users browsing this thread: 2 Guest(s)