20.07.2015, 18:00
You can't directly check a player his VIP level once he connects, if I'm correct it keeps showing that the player has vip level 0 when he connects, right?
Try this;
Try this;
Код:
// along with all other variables; new vipchecker[MAX_PLAYERS]; public OnPlayerConnect(playerid) { vipchecker[playerid] = -1; vipchecker[playerid] = SetTimerEx("VipCheckMessage", 2000, false, "i", playerid); if(!fexist(UserPath(playerid)) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File, "VIP", 0); INI_Close(File); } else INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); return 1; } forward VipCheckMessge(playerid); public VipCheckMessage(playerid) { if(IsPlayerConnected(playerid) && Vip[playerid] > 0) { new string[90]; format(string, sizeof(string), " Welcome back, %s. Your V.I.P. level is: %d", PlayerName(playerid), Vip[playerid]); SendClientMessage(playerid ,COLOR_RED, string); } else return 1; return 1; }