26.07.2012, 00:11
Command /setvip error.
When i /setvip [playerid] [level] [days]
i type example /setvip 4 1 5
And it set my day 0 and send message my vip expired
Here comand
When i /setvip [playerid] [level] [days]
i type example /setvip 4 1 5
And it set my day 0 and send message my vip expired
Here comand
Quote:
CMDetvip(playerid, params[]) { new VIPID; new level; new time; if(PlayerInfo[playerid][pAdmin] >= 1337) { if(sscanf(params, "udd", VIPID, level, time)) return SendClientMessage(playerid, COLOR_GREY,"/setvip [playerid] [level] [days]"); if(IsPlayerConnected(VIPID)) { if(level >= 0 && level <= 5) { if(time >= -1 && time <= 365) { new playerName[MAX_PLAYER_NAME], string[79]; GetPlayerName(VIPID, playerName, sizeof(playerName)); if(level == 0) { format(string, sizeof(string), "Administrator %s has revoked your VIP status.", PlayerInfo[playerid][pAdmin]); SendClientMessage(VIPID, COLOR_NICESKY, string); format(string, sizeof(string), "You have revoked %s's VIP status.", playerName); SendClientMessage(playerid, COLOR_WHITE, string); PlayerInfo[VIPID][pPlayerVIPExpires] = 0; } else if(time == -1) { format(string, sizeof(string), "You have made %s a permanent level %d VIP.", playerName, level); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Administrator %s has granted you permanent VIP level %d.", PlayerInfo[playerid][pAdmin], level); SendClientMessage(VIPID, COLOR_NICESKY, string); PlayerInfo[VIPID][pPlayerVIPExpires] = -1; } else { format(string, sizeof(string), "You have made %s a level %d VIP, for %d days.", playerName, level, time); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Administrator %s has granted you VIP level %d, for %d days.", PlayerInfo[playerid][pAdmin], level, time); SendClientMessage(VIPID, COLOR_NICESKY, string); PlayerInfo[VIPID][pPlayerVIPExpires] = gettime() + (time * 24 * 60 * 60); } PlayerInfo[VIPID][pVIP] = level; } else SendClientMessage(playerid, COLOR_GREY, "Valid times are -1 (permanent) to 365 days (one year)."); } else SendClientMessage(playerid, COLOR_GREY, "Valid VIP levels are 0 to 5."); } else SendClientMessage(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated."); } return 1; } |