SA-MP Forums Archive
PlayerRegister Date - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PlayerRegister Date (/showthread.php?tid=74776)



PlayerRegister Date - Mike-Chip - 26.04.2009

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


Re: PlayerRegister Date - Backwardsman97 - 26.04.2009

Because RegDate is not a string.


Re: PlayerRegister Date - Mike-Chip - 26.04.2009

How do I "transform" it into a string ? possible ?


Re: PlayerRegister Date - Backwardsman97 - 26.04.2009

pawn Код:
new RegDate[12];

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



Re: PlayerRegister Date - Mike-Chip - 26.04.2009

thanks dude


worked fine :P


Re: PlayerRegister Date - Backwardsman97 - 26.04.2009

No problem.