13.07.2014, 09:31
No.
MAX_COUNTRY_NAME is used inside of an array, so it must have a size.
24 is the size, I assume it's a name so let's just go with the size of MAX_PLAYER_NAME, which is 24.
Don't change the gmt, the error may have been caused because MAX_COUNTRY_NAME caused the error.
Try this:
EDIT: You use the size 256 multiple times in your script. I won't change anything but just know that it's very unefficient to use large sizes for small text. Get the correct number of letters by using this: http://www.lettercount.com/
MAX_COUNTRY_NAME is used inside of an array, so it must have a size.
pawn Код:
#define MAX_COUNTRY_NAME 24
Don't change the gmt, the error may have been caused because MAX_COUNTRY_NAME caused the error.
Try this:
pawn Код:
#define MAX_COUNTRY_NAME 24
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], country[MAX_COUNTRY_NAME], gmt;
new string[256];
GetPlayerName(playerid, name, sizeof(name));
country = GetPlayerCountryName(playerid);
gmt = GetPlayerGMT(playerid);
format(string, sizeof(string), "[JOIN] %s (%s, GMT %d:00)", name, country, gmt);
SendClientMessageToAll(COLOR_GREEN,string);
SendClientMessage(playerid, 0xFFFF00AA,"Please use /register if you dont have an account!");
SendClientMessage(playerid, COLOR_RED,"Use /v to spawn a vehicle, if you need help use /help!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Welcome to SDC", "Welcome to our server!\nDown here are some commands that can be usefull:\n/v to spawn a car\n/admins to see a list of online admins\n/cmds will show a list of commands\nPress 2 for a car/bike hop\nPress alt to get a speed boost\nPress h to flip your car\nDONT DM outside DM zones, dont hack and have fun!!", "Ok", "");
return 1;
}