help me in this error!
#1

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;

}









This is error:-
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1020) : error 017: undefined symbol "MAX_COUNTRY_NAME"
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1020) : error 029: invalid expression, assumed zero
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1020) : error 017: undefined symbol "gmt"
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1020) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.






is their is anything that i have to define??
Reply
#2

define the
pawn Код:
MAX_COUNTRY_NAME
and

pawn Код:
gmt
Reply
#3

#define[MAX_COUNTRY_NAME]
#define gmt

like this?
Reply
#4

like this

pawn Код:
new MAX_COUNTRY_NAME
new gtm
Reply
#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
#6

after writing ur code:

3 error left

C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1023) : error 017: undefined symbol "GetPlayerCountryName"
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1023) : error 033: array must be indexed (variable "country")
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1024) : error 017: undefined symbol "GetPlayerGMT"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

Where did you get this script from? Country requires a value since you defined it to have a size.

pawn Код:
country[value];
As for the rest, you need the functions in order to get this to work. Don't just copy and paste scripts, lol.
Reply
#8

you need this plugin+its include https://sampforum.blast.hk/showthread.php?tid=32509
Reply
#9

I'm pretty sure you need to include GeoIP_Plugin and have the plugin loaded: https://sampforum.blast.hk/showthread.php?tid=32509

EDIT: I had to refresh the page.
Reply
#10

i already include GeoIP_Plugins

These error left now:-
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1023) : error 017: undefined symbol "GetPlayerCountryName"
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1023) : error 033: array must be indexed (variable "country")
C:\Users\vishal\Desktop\New folder (2\GM\gs.pwn(1024) : error 017: undefined symbol "GetPlayerGMT"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)