PlayerRegister Date
#1

Okay, again... (¬¬) another problem... in "my" gamemode has a function that when a player register, it will get date (like RegisteredDate=25/04/2009), and the register date must be in one line...

Код:
Line: 2019 if(strcmp(cmd, "/stats", true) == 0) {
Line: 2020 new RegDate = dini_Get(String, "RegisteredDate");
Line: 2021 format(string, sizeof(string), "STATS: Bank: %d, Tickets: %d, Properties: %d, Points: %d, Registered Date: %s", PlayerInfo[playerid][bank], PlayerInfo[playerid][tickets], PlayerInfo[playerid][props], GetPlayerScore(playerid), RegDate);
Line: 2022 SendClientMessage(playerid, COLOR_WHITE, string);
Line: 2023 return 1;
Line: 2024 }
Код:
stock CreatePlayer(playerid)
{
new strdate[20], year,month,day;
getdate(year, month, day);

format(strdate, sizeof(strdate), "%d/%d/%d", day, month, year);
if(dini_Exists(String))
{
dini_Set(String, "RegisteredDate", strdate);
but when I try to compile it gives an error
Код:
D:/GTASAN~1/GTASAM~1/GAMEMO~1/lswars.pwn(2020) : error 033: array must be indexed (variable "-unknown-")
Thanks in advance
Reply
#2

Because RegDate is not a string.
Reply
#3

How do I "transform" it into a string ? possible ?
Reply
#4

pawn Код:
new RegDate[12];

format(RegDate,12,"%s",dini_Get(String, "RegisteredDate"));
Reply
#5

thanks dude


worked fine :P
Reply
#6

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)