/setvip problem
#1

I created a "setvip" command, but sadly I've failed again ;______;
I keep having the message "ID blabla is already a vip", even though i have it set to 0 OnPlayerConnect.
Codes:

pawn Код:
CMD:setvip(playerid, params[]) {
    new id;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ADMIN] - Only admins can use this command!");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "[ERROR] - Player not found!");
    if(PlayerInfo[id][pVip] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "[VIP] - That player is already a VIP.");
    new string[128],pname[MAX_PLAYER_NAME],recievername[MAX_PLAYER_NAME];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "[USAGE] - /setvip [ID]");
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(id,recievername,sizeof(recievername));
    format(string, sizeof(string), "[ADMIN] - %s[%d] has used SETVIP on %s[%d]", pname, playerid, recievername, id);
    SendMessageToAdmins(string);
    format(string, sizeof(string), "[VIP] - Admin %s[%d] has set you as a vip, congratulations!", pname, playerid);
    SendClientMessage(id, COLOR_GREEN, string);
    SendClientMessage(id, COLOR_GREEN, "[VIP] - As a VIP, you can now use /vipcmds!");
    PlayerInfo[id][pVip] = 1;
    return 1;
}
pawn Код:
//OnPlayerConnect
    PlayerInfo[playerid][pVip] = 0;
EDIT: I have every include/plugin etc. up-to-date
Reply
#2

Print this variable with function printf(const format[], {Float,_}:...) after this message.
Reply
#3

Quote:
Originally Posted by Ardendshy
Посмотреть сообщение
Print this variable with function printf(const format[], {Float,_}:...) after this message.
Under which message..?
And uh.. will i need to edit something in the printf(Also how will that help? xd)
Actually, I've found out that the VIP and the score doesn't save, not sure why ;___;


EDIT: The VIP var/enum saves in the Users files, but the Score doesn't.
I guess something is messed up with the loading for the VIP..
Reply
#4

So sorry for the double-post, but i think that i fixed it.. All i did was put
pawn Код:
if(PlayerInfo[id][pVip] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "[VIP] - That player is already a VIP.");
Under the "if(sscanf( ....", and it seemed to work.
Well, thanks for the attempts..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)