Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- System created by: James_Barnes (OfekEfron),
- System using RCON Admin!
- You need to open a folder name: VIP in scriptfiles.
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #include <DOF2>
- //====<new>====
- new str[500];
- public OnFilterScriptInit()
- {
- DOF2_Exit();
- return 1;
- }
- CMD:setvipmanager(playerid,params[])
- {
- if(!SVIP(playerid) && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You dont have access to this command");
- if(sscanf(params,"u",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /SetVipManager [ID]");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"Worng ID");
- if(!DOF2_FileExists(VIPFile(params[0]))) DOF2_CreateFile(VIPFile(params[0]));
- DOF2_SetString(VIPFile(params[0]),"Name",GetName(params[0]));
- DOF2_SetString(VIPFile(params[0]),"VIP" , "Yes");
- DOF2_SaveFile();
- format(str,sizeof str,"{ffaa00}%s became a vip manager",GetName(params[0]));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:delvipmanager(playerid,params[])
- {
- if(!SVIP(playerid) && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You dont have access to this command");
- if(sscanf(params,"u",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /RemoveVipManager [ID]");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"Worng ID");
- if(!SVIP(params[0])) return SendClientMessage(playerid,COLOR_RED,"This player isnt a VIP");
- DOF2_RemoveFile(VIPFile(params[0]));
- format(str,sizeof str,"{ffaa00}%s removed from vip manager",GetName(params[0]));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:setvip(playerid,params[])
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You dont have access to this command");
- if(sscanf(params,"u",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /SetVip [ID]");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"Worng ID");
- if(!DOF2_FileExists(VIPFile(params[0]))) DOF2_CreateFile(VIPFile(params[0]));
- DOF2_SetString(VIPFile(params[0]),"Name",GetName(params[0]));
- DOF2_SetString(VIPFile(params[0]),"VIP" , "Yes");
- DOF2_SaveFile();
- format(str,sizeof str,"{ffaa00}%s became a vip",GetName(params[0]));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:delvip(playerid,params[])
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You dont have access to this command");
- if(sscanf(params,"u",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /DelVip [ID]");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"Worng ID");
- if(!SVIP(params[0])) return SendClientMessage(playerid,COLOR_RED,"This player isnt a VIP");
- DOF2_RemoveFile(VIPFile(params[0]));
- format(str,sizeof str,"{ffaa00}%s has removed from VIP",GetName(params[0]));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:vsay(playerid,params[])
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You arent VIP");
- if(sscanf(params,"s",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /Vsay - [Text]");
- format(str,sizeof str,"{00aaff}VIP Say {ffaa00}%s: %s",GetName(playerid),(params[0]));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:vgoto(playerid,params[])
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You arent VIP");
- if(sscanf(params,"u",params[0])) return SendClientMessage(playerid,COLOR_RED,"Usage: /VGoto [ID]");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"Worng ID");
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(params[0],X,Y,Z);
- SetPlayerPos(params[0],X+2,Y,Z);
- format(str,sizeof str,"Vip %s teleported to %s",GetName(params[0]),GetName(playerid));
- SendClientMessageToAll(-1,str);
- return 1;
- }
- CMD:vipcolor(playerid,params[])
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You arent VIP");
- SetPlayerColor(playerid,0xffff00AA);
- format(str,sizeof str,"{ffaa00}You have change your color to VIP color.");
- SendClientMessage(playerid,-1,str);
- return 1;
- }
- CMD:viphelp(playerid)
- {
- if(!SVIP(playerid)) return SendClientMessage(playerid,COLOR_RED,"You arent VIP");
- ShowPlayerDialog(playerid,555,DIALOG_STYLE_MSGBOX,"{00aaff}~ {ffaa00}V.I.P System {00aaff}~","{00ffff}# /SetVipManager - Give VIPManager to player\n# /DelVipManager - Remove VIPManager from player\n# /SetVip - Invite someone to VIP\n# /Vsay - Saying in global chat like VIP\n# /SetVipColor - Set your color to VIP color\n# /Vgoto - Teleport to someone\n# /VipList - List of VIP players online","OK","");
- return 1;
- }
- CMD:viplist(playerid,params[])
- {
- new players,str2[500];
- for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i))
- {
- if(SVIP(i))
- {
- players++;
- format(str,sizeof str,"{00aaff}%d. %s [ID: %i | {ffaa00}V.I.P{00aaff}]",players,GetName(i),i);
- strcat(str2,str);
- }
- }
- return ShowPlayerDialog(playerid,444, DIALOG_STYLE_MSGBOX,"{ffaa00}V.I.P List", (!players)?("{ff0000}There are no VIP's players online"):(str2),"OK","");
- }
- //=======================<stock>=======================
- stock GetName(playerid)
- {
- new pName[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid,pName,sizeof(pName));
- return pName;
- }
- stock VIPFile(playerid)
- {
- new File[50];
- format(File, sizeof File, "VIP/%s.ini", GetName(playerid));
- return File;
- }
- stock SVIP(playerid) return DOF2_FileExists(VIPFile(playerid)) ? true:false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement