help me in this error!
#5

Quote:
Originally Posted by Team_PRO
Посмотреть сообщение
like this

pawn Код:
new MAX_COUNTRY_NAME
new gtm
No.

MAX_COUNTRY_NAME is used inside of an array, so it must have a size.

pawn Код:
#define MAX_COUNTRY_NAME 24
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:

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;
}
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/
Reply


Messages In This Thread
help me in this error! - by PrinXe - 13.07.2014, 09:19
Re: help me in this error! - by Team_PRO - 13.07.2014, 09:22
Re: help me in this error! - by PrinXe - 13.07.2014, 09:24
Re: help me in this error! - by Team_PRO - 13.07.2014, 09:27
Re: help me in this error! - by Dignity - 13.07.2014, 09:31
Re: help me in this error! - by PrinXe - 13.07.2014, 09:34
Re: help me in this error! - by Dignity - 13.07.2014, 09:36
Re: help me in this error! - by BroZeus - 13.07.2014, 09:36
Re: help me in this error! - by Konstantinos - 13.07.2014, 09:38
Re: help me in this error! - by PrinXe - 13.07.2014, 09:40

Forum Jump:


Users browsing this thread: 3 Guest(s)