/setvip problem - 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: /setvip problem (
/showthread.php?tid=478634)
/setvip problem -
Kyance - 30.11.2013
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
Re: /setvip problem -
Ardendshy - 30.11.2013
Print this variable with function
printf(const format[], {Float,_}:...) after this message.
Re: /setvip problem -
Kyance - 30.11.2013
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..
Re: /setvip problem -
Kyance - 30.11.2013
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..