timer CoinHour[300000](playerid) { SendClientMessage(playerid, COLOR_GREEN, "LUCKY DRAW: You've got 1 Coins that can be used in /luckydraw"); DataPlayer[playerid][pcoin] += 1; new INI:File = INI_Open(LDPath(playerid)); INI_SetTag(File,"DataPlayer"); INI_WriteInt(File,"Coins",DataPlayer[playerid][pcoin]); INI_Close(File); } |
public OnPlayerConnect(playerid) { DrawOn[playerid] = 0; repeat CoinHour(playerid); if(fexist(LDPath(playerid))) { INI_ParseFile(LDPath(playerid), "LoadPlayer_%s", .bExtra = true, .extra = playerid); } return 1; } |
public OnPlayerConnect(playerid)
{
DrawOn[playerid] = 0;
repeat CoinHour(playerid);
if(fexist(LDPath(playerid)))
{
INI_ParseFile(LDPath(playerid), "LoadPlayer_%s", .bExtra = true, .extra = playerid);
}
return 1;
}
public OnGameModeInit() {
HourTimer();
return 1;
}
task HourTimer[3600000]() {
foreach(new i : Player) {
// Coin draw
SendClientMessage(i, COLOR_GREEN, "LUCKY DRAW: You've got 1 coin that can be used in /luckydraw!");
DataPlayer[i][pcoin] ++;
new INI:File = INI_Open(LDPath(i));
INI_SetTag(File, "DataPlayer");
INI_WriteInt(File, "Coins", DataPlayer[i][pcoin]);
INI_Close(File);
}
}
task HourTimer[3600000]() {
foreach(new i : Player) {
if(!DataPlayer[i][ploggedin]) {
continue;
}
// Coin draw
SendClientMessage(i, COLOR_GREEN, "LUCKY DRAW: You've got 1 coin that can be used in /luckydraw!");
DataPlayer[i][pcoin] ++;
new INI:File = INI_Open(LDPath(i));
INI_SetTag(File, "DataPlayer");
INI_WriteInt(File, "Coins", DataPlayer[i][pcoin]);
INI_Close(File);
}
}