PDA

View Full Version : Setlevel command working just for me


Fabyx15
11/07/2018, 10:29 AM
If i setvlevel to myself, it is showing correct, if i setvlevel to someone that is not me, it's showing,VIP level set to 0.....

CMD:setvlevel(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_ERROR,"Error: You must be logged in as RCON!");
new string[128], userid;
if(sscanf(params, "ui", userid, PlayerInfo[userid][pVIP])) return SCM(playerid,COLOR_GREY,"Usage: /setvlevel [UserID] [Level]");
if(userid == INVALID_PLAYER_ID) return SCM(playerid,COLOR_ERROR,"Error: Player is not connected!");
format(string, sizeof(string), "Admin %s has set your VIP LEVEL to %i", GetName(playerid), PlayerInfo[userid][pVIP]);
SCM(userid,COLOR_ORANGERED,string);
format(string, sizeof(string), "You've set %s VIP LEVEL to %i", GetName(userid), PlayerInfo[userid][pVIP]);
SCM(playerid,COLOR_ORANGERED,string);
PlayerPlaySound(playerid,1137,0.0,0.0,0.0);
PlayerPlaySound(userid,1137,0.0,0.0,0.0);
return 1;
}

Stev
11/07/2018, 10:33 AM
new level;
if (sscanf(params, "ud", userid, level))

PlayerInfo[userid][pVIP] = level;

Fabyx15
11/07/2018, 10:33 AM
I'm gonna try it, but it's not the same?

Florin48
11/07/2018, 10:42 AM
I'm gonna try it, but it's not the same?

No, it's completely different.

Fabyx15
11/07/2018, 10:55 AM
Now i'm setting the vip level correct, but when i do /stats or i try some commands that needs vip, it says i have / or someone has vip level 0....

Fabyx15
11/07/2018, 11:12 AM
Solved by putting PlayerInfo[userid][pVIP] = level; under sscanf :D