SA-MP Forums Archive
Setlevel command working just for me - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Setlevel command working just for me (/showthread.php?tid=656254)



Setlevel command working just for me - Fabyx15 - 11.07.2018

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;
}



Re: Setlevel command working just for me - Stev - 11.07.2018

Код:
new level;
if (sscanf(params, "ud", userid, level))

PlayerInfo[userid][pVIP] = level;



Re: Setlevel command working just for me - Fabyx15 - 11.07.2018

I'm gonna try it, but it's not the same?


Re: Setlevel command working just for me - Florin48 - 11.07.2018

Quote:
Originally Posted by Fabyx15
Посмотреть сообщение
I'm gonna try it, but it's not the same?
No, it's completely different.


Re: Setlevel command working just for me - Fabyx15 - 11.07.2018

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....


Re: Setlevel command working just for me - Fabyx15 - 11.07.2018

Solved by putting PlayerInfo[userid][pVIP] = level; under sscanf