Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ////////////////////////////////////////////////////////
- / Glad 2 Be Here VIP SYSTEM /////
- / Dynamic Script //////
- / //////
- / //////
- / KEEP ALL CREDITS!!!!!!!!!!!!!!!!!!! //////
- ////////////////////////////////////////////////////////
- */
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #include <a_samp>
- #include <YSI\y_ini>
- #include <sscanf2>
- #include <streamer>
- #include <foreach>
- #include <zcmd>
- #include <mSelection>
- #define COLOR_GREEN 0x33AA33FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_RED 0xFF0606FF
- #define COLOR_LIGHTBLUE 0x33CCFFFF
- #define COLOR_YELLOW 0xFFFF00FF
- #define DIALOG_REGISTER 1231
- #define DIALOG_LOGIN 1232
- #define DIALOG_SHOP 1233
- #define DIALOG_WEAPONINPUT 1234
- #define DIALOG_AMMOINPUT 1235
- #define DIALOG_RADIO 1236
- #define MAX_HQS 5
- #define MAX_SHOPS 10
- #define MAX_VCARS 100
- new LoggedIn[MAX_PLAYERS];
- new VCSTATUS[MAX_PLAYERS];
- new pGun[MAX_PLAYERS];
- new pAmmo[MAX_PLAYERS];
- new vskins = mS_INVALID_LISTID;
- new PlayerText3D:vlabel;
- enum VInfo
- {
- Vpass,
- VipLevel,
- VNickName[32],
- VGold
- }
- new VipAccount[MAX_PLAYERS][VInfo];
- enum VShopInfo
- {
- Float:VSPos[3],
- VScreated,
- Vpickup,
- Text3D:VshopText
- }
- new VipShop[MAX_SHOPS][VShopInfo];
- enum VHqInfo
- {
- Float:VHQEnPos[3],
- Float:VHQExPos[3],
- HqInterior,
- VHQcreated,
- HQpickup[2],
- Text3D:VHQText[2]
- }
- new VHq[MAX_HQS][VHqInfo];
- enum VCarInfo
- {
- Model,
- Float:CPos[4],
- Col[2],
- VCreated,
- VType,
- Car
- }
- new VCar[MAX_VCARS][VCarInfo];
- stock VipHQPath(id)
- {
- new string[128];
- format(string,sizeof(string),"GVIP/HQ/%d.ini",id);
- return string;
- }
- stock VipStorePath(id)
- {
- new string[128];
- format(string,sizeof(string),"GVIP/STORE/%d.ini",id);
- return string;
- }
- stock VipPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),"GVIP/VIP/%s.ini",playername);
- return string;
- }
- stock VipMessage(color, string[])
- {
- foreach(Player, i)
- {
- if(LoggedIn[i] && VipAccount[i][VipLevel] && VCSTATUS[i])
- {
- SendClientMessage(i, color, string);
- }
- }
- return 1;
- }
- stock GetPlayerGold(playerid)
- {
- return VipAccount[playerid][VGold];
- }
- stock Name(playerid)
- {
- new vipname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, vipname, sizeof(vipname));
- return vipname;
- }
- stock VipName(Level)
- {
- new name[32];
- if(Level == 0) format(name, sizeof(name), "None");
- else if(Level == 1) format(name, sizeof(name), "Bronze");
- else if(Level == 2) format(name, sizeof(name), "Silver");
- else if(Level == 3) format(name, sizeof(name), "Gold");
- else if(Level == 4) format(name, sizeof(name), "Platinum");
- return name;
- }
- stock udb_hash(buf[])
- {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- forward LoadCar_data(cid, name[],value[]);
- public LoadCar_data(cid, name[],value[])
- {
- INI_Int("Model", VCar[cid][Model]);
- INI_Float("X", VCar[cid][CPos][0]);
- INI_Float("Y", VCar[cid][CPos][1]);
- INI_Float("Z", VCar[cid][CPos][2]);
- INI_Float("A", VCar[cid][CPos][3]);
- INI_Int("C1", VCar[cid][Col][0]);
- INI_Int("C2", VCar[cid][Col][1]);
- INI_Int("Created", VCar[cid][VCreated]);
- INI_Int("Type", VCar[cid][VType]);
- return 1;
- }
- forward LoadVCars();
- public LoadVCars()
- {
- for(new c=0; c < MAX_VCARS; c++)
- {
- if(fexist(VipCarPath(c)))
- {
- INI_ParseFile(VipCarPath(c), "LoadCar_%s", .bExtra = true, .extra = c);
- if(VCar[c][VCreated])
- {
- VCar[c][Car] = CreateVehicle(VCar[c][Model], VCar[c][CPos][0], VCar[c][CPos][1], VCar[c][CPos][2], VCar[c][CPos][3], VCar[c][Col][0], VCar[c][Col][1], -1);
- }
- }
- else
- {
- new INI:File = INI_Open(VipCarPath(c));
- INI_WriteInt(File, "Model", 0);
- INI_WriteFloat(File, "X", 0);
- INI_WriteFloat(File, "Y", 0);
- INI_WriteFloat(File, "Z", 0);
- INI_WriteFloat(File, "A", 0);
- INI_WriteInt(File, "C1", 0);
- INI_WriteInt(File, "C2", 0);
- INI_WriteInt(File, "Created", 0);
- INI_WriteInt(File, "Type", 0);
- INI_Close(File);
- }
- }
- print("Car's Loaded");
- return 1;
- }
- forward SaveVCars();
- public SaveVCars()
- {
- for(new cid=0; cid < MAX_VCARS; cid++)
- {
- new INI:File = INI_Open(VipCarPath(cid));
- INI_WriteInt(File, "Model", VCar[cid][Model]);
- INI_WriteFloat(File, "X", VCar[cid][CPos][0]);
- INI_WriteFloat(File, "Y", VCar[cid][CPos][1]);
- INI_WriteFloat(File, "Z", VCar[cid][CPos][2]);
- INI_WriteFloat(File, "A", VCar[cid][CPos][3]);
- INI_WriteInt(File, "C1", VCar[cid][Col][0]);
- INI_WriteInt(File, "C2", VCar[cid][Col][1]);
- INI_WriteInt(File, "Created", VCar[cid][VCreated]);
- INI_WriteInt(File, "Type", VCar[cid][VType]);
- INI_Close(File);
- }
- print("Car's Saved");
- return 1;
- }
- stock VipCarPath(id)
- {
- new string[128];
- format(string,sizeof(string),"GVIP/CARS/%d.ini",id);
- return string;
- }
- forward LoadVIP_data(playerid,name[],value[]);
- public LoadVIP_data(playerid,name[],value[])
- {
- INI_Int("Level",VipAccount[playerid][VipLevel]);
- INI_String("NickName",VipAccount[playerid][VNickName], 32);
- INI_Int("Gold",VipAccount[playerid][VGold]);
- return 1;
- }
- forward LoadVIPPass_data(playerid,name[],value[]);
- public LoadVIPPass_data(playerid,name[],value[])
- {
- INI_Int("Password",VipAccount[playerid][Vpass]);
- return 1;
- }
- forward LoadVIPSTORE_data(vsid,name[],value[]);
- public LoadVIPSTORE_data(vsid,name[],value[])
- {
- INI_Float("X",VipShop[vsid][VSPos][0]);
- INI_Float("Y",VipShop[vsid][VSPos][1]);
- INI_Float("Z",VipShop[vsid][VSPos][2]);
- INI_Int("Created",VipShop[vsid][VScreated]);
- return 1;
- }
- forward LoadVShops();
- public LoadVShops()
- {
- for(new vs=0; vs < MAX_SHOPS; vs++)
- {
- if(fexist(VipStorePath(vs)))
- {
- INI_ParseFile(VipStorePath(vs), "LoadVIPSTORE_%s", .bExtra = true, .extra = vs);
- if(VipShop[vs][VScreated])
- {
- VipShop[vs][Vpickup] = CreateDynamicPickup(1239, 1, VipShop[vs][VSPos][0],VipShop[vs][VSPos][1], VipShop[vs][VSPos][2], -1);
- VipShop[vs][VshopText] = CreateDynamic3DTextLabel("Vip Store",COLOR_LIGHTBLUE,VipShop[vs][VSPos][0],VipShop[vs][VSPos][1], VipShop[vs][VSPos][2]+0.3, 10);
- }
- }
- else
- {
- new INI:File = INI_Open(VipStorePath(vs));
- INI_WriteFloat(File, "X",0);
- INI_WriteFloat(File, "Y",0);
- INI_WriteFloat(File, "Z",0);
- INI_WriteInt(File, "Created",0);
- INI_Close(File);
- }
- }
- print("Stores's Loaded");
- return 1;
- }
- forward SaveVShops();
- public SaveVShops()
- {
- for(new vs=0;vs < MAX_SHOPS; vs++)
- {
- new INI:File = INI_Open(VipStorePath(vs));
- INI_WriteFloat(File, "X",VipShop[vs][VSPos][0]);
- INI_WriteFloat(File, "Y",VipShop[vs][VSPos][1]);
- INI_WriteFloat(File, "Z",VipShop[vs][VSPos][2]);
- INI_WriteInt(File, "Created",VipShop[vs][VScreated]);
- INI_Close(File);
- }
- print("Stores's Saved");
- return 1;
- }
- forward LoadVIPHQS_data(hqid,name[],value[]);
- public LoadVIPHQS_data(hqid,name[],value[])
- {
- INI_Float("EN_X", VHq[hqid][VHQEnPos][0]);
- INI_Float("EN_Y", VHq[hqid][VHQEnPos][1]);
- INI_Float("EN_Z", VHq[hqid][VHQEnPos][2]);
- INI_Float("Ex_X", VHq[hqid][VHQExPos][0]);
- INI_Float("Ex_Y", VHq[hqid][VHQExPos][1]);
- INI_Float("Ex_Z", VHq[hqid][VHQExPos][2]);
- INI_Int("Interior", VHq[hqid][HqInterior]);
- INI_Int("Created", VHq[hqid][VHQcreated]);
- return 1;
- }
- forward LoadVipHq();
- public LoadVipHq()
- {
- for(new hq=0; hq < MAX_HQS; hq++)
- {
- if(fexist(VipHQPath(hq)))
- {
- INI_ParseFile(VipStorePath(hq), "LoadVIPHQS_%s", .bExtra = true, .extra = hq);
- if(VHq[hq][VHQcreated])
- {
- VHq[hq][HQpickup][0] = CreateDynamicPickup(1239, 1, VHq[hq][VHQEnPos][0],VHq[hq][VHQEnPos][1],VHq[hq][VHQEnPos][2],-1);
- VHq[hq][VHQText][0] = CreateDynamic3DTextLabel("Vip Hq Entrance",COLOR_LIGHTBLUE,VHq[hq][VHQEnPos][0],VHq[hq][VHQEnPos][1],VHq[hq][VHQEnPos][2]+0.3, 10);
- VHq[hq][HQpickup][1] = CreateDynamicPickup(1239, 1, VHq[hq][VHQExPos][0],VHq[hq][VHQExPos][1],VHq[hq][VHQExPos][2],-1, VHq[hq][HqInterior]);
- VHq[hq][VHQText][1] = CreateDynamic3DTextLabel("Vip Hq Exit",COLOR_LIGHTBLUE,VHq[hq][VHQExPos][0],VHq[hq][VHQExPos][1],VHq[hq][VHQExPos][2]+0.3, 10);
- }
- }
- else
- {
- new INI:File = INI_Open(VipHQPath(hq));
- INI_WriteFloat(File, "EN_X", 0);
- INI_WriteFloat(File, "EN_Y", 0);
- INI_WriteFloat(File, "EN_Z", 0);
- INI_WriteFloat(File, "Ex_X", 0);
- INI_WriteFloat(File, "Ex_Y", 0);
- INI_WriteFloat(File, "Ex_Z", 0);
- INI_WriteInt(File, "Interior", 0);
- INI_WriteInt(File, "Created", 0);
- INI_Close(File);
- }
- }
- print("HQ's Loaded");
- return 1;
- }
- forward SaveVipHq();
- public SaveVipHq()
- {
- for(new hq=0; hq < MAX_HQS; hq++)
- {
- new INI:File = INI_Open(VipHQPath(hq));
- INI_WriteFloat(File, "EN_X", VHq[hq][VHQEnPos][0]);
- INI_WriteFloat(File, "EN_Y", VHq[hq][VHQEnPos][1]);
- INI_WriteFloat(File, "EN_Z", VHq[hq][VHQEnPos][2]);
- INI_WriteFloat(File, "Ex_X", VHq[hq][VHQExPos][0]);
- INI_WriteFloat(File, "Ex_Y", VHq[hq][VHQExPos][1]);
- INI_WriteFloat(File, "Ex_Z", VHq[hq][VHQExPos][2]);
- INI_WriteInt(File, "Interior", VHq[hq][HqInterior]);
- INI_WriteInt(File, "Created", VHq[hq][VHQcreated]);
- INI_Close(File);
- }
- print("HQ's saved");
- return 1;
- }
- CMD:gvah(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- SendClientMessage(playerid, COLOR_GREEN, "/makevip, /givegold, /createvipshop, /vhqedit");
- SendClientMessage(playerid, COLOR_GREEN, "/createvcar, /destroyvcar");
- return 1;
- }
- CMD:makevip(playerid, params[])
- {
- new string[256], playerb, level;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- if(sscanf(params, "ui", playerb, level)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makevip [playerid] [level]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "That Player is Not Connect");
- foreach(Player, i)
- {
- if(IsPlayerAdmin(i))
- {
- format(string, 256, "%s Has Made %s Vip Level: %s (%d)", Name(playerid), Name(playerb), VipName(level), level);
- SendClientMessage(i, COLOR_RED, string);
- }
- }
- VipAccount[playerb][VipLevel] = level;
- return 1;
- }
- CMD:givegold(playerid, params[])
- {
- new string[256], playerb, gold;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- if(sscanf(params, "ui", playerb, gold)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givegold [playerid] [amount]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "That Player is Not Connect");
- foreach(Player, i)
- {
- if(IsPlayerAdmin(i))
- {
- format(string, 256, "%s Has Made %s $%d Gold", Name(playerid), Name(playerb), gold);
- SendClientMessage(i, COLOR_RED, string);
- }
- }
- VipAccount[playerb][VGold] = gold;
- SendClientMessage(playerb, COLOR_GREEN, "The Gold is Not Tradable");
- return 1;
- }
- CMD:createvipshop(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- for(new vs=0; vs < MAX_SHOPS; vs++)
- {
- if(!VipShop[vs][VScreated])
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- VipShop[vs][VSPos][0] = X;
- VipShop[vs][VSPos][1] = Y;
- VipShop[vs][VSPos][2] = Z;
- VipShop[vs][VScreated] = 1;
- VipShop[vs][Vpickup] = CreateDynamicPickup(1239, 1, VipShop[vs][VSPos][0],VipShop[vs][VSPos][1], VipShop[vs][VSPos][2], -1);
- VipShop[vs][VshopText] = CreateDynamic3DTextLabel("Vip Store",COLOR_LIGHTBLUE,VipShop[vs][VSPos][0],VipShop[vs][VSPos][1], VipShop[vs][VSPos][2]+0.3, 10);
- }
- }
- return 1;
- }
- CMD:vhqedit(playerid, params[])
- {
- new Float: X, Float: Y, Float: Z, id;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- if(sscanf(params, "s[32]", params))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /vhqedit [option] [id]");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "OPTIONS: entrance | exit");
- return 1;
- }
- if(!strcmp(params, "entrance", true, 8))
- {
- if(sscanf(params, "s[32]i", params, id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vhqedit entrance [id]");
- GetPlayerPos(playerid, X, Y, Z);
- if(!VHq[id][VHQcreated]) return VHq[id][VHQcreated] = 1;
- VHq[id][VHQEnPos][0] = X;
- VHq[id][VHQEnPos][1] = Y;
- VHq[id][VHQEnPos][2] = Z;
- if(VHq[id][HQpickup][0]) DestroyDynamicPickup(VHq[id][HQpickup][0]);
- if(VHq[id][VHQText][0]) DestroyDynamic3DTextLabel(VHq[id][VHQText][0]);
- VHq[id][HQpickup][0] = CreateDynamicPickup(1239, 1, VHq[id][VHQEnPos][0],VHq[id][VHQEnPos][1],VHq[id][VHQEnPos][2],-1);
- VHq[id][VHQText][0] = CreateDynamic3DTextLabel("Vip Hq Entrance",COLOR_LIGHTBLUE,VHq[id][VHQEnPos][0],VHq[id][VHQEnPos][1],VHq[id][VHQEnPos][2]+0.3, 10);
- SendClientMessage(playerid, COLOR_RED, "Entrance Is Now at Your Location");
- }
- else if(!strcmp(params, "exit", true, 4))
- {
- if(sscanf(params, "s[32]i", params, id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vhqedit exit [id]");
- GetPlayerPos(playerid, X, Y, Z);
- if(!VHq[id][VHQcreated]) VHq[id][VHQcreated] = 1;
- VHq[id][VHQExPos][0] = X;
- VHq[id][VHQExPos][1] = Y;
- VHq[id][VHQExPos][2] = Z;
- new i = GetPlayerInterior(playerid);
- VHq[id][HqInterior] = i;
- if(VHq[id][HQpickup][1]) DestroyDynamicPickup(VHq[id][HQpickup][1]);
- if(VHq[id][VHQText][1]) DestroyDynamic3DTextLabel(VHq[id][VHQText][1]);
- VHq[id][HQpickup][1] = CreateDynamicPickup(1239, 1, VHq[id][VHQExPos][0],VHq[id][VHQExPos][1],VHq[id][VHQExPos][2],-1, VHq[id][HqInterior]);
- VHq[id][VHQText][1] = CreateDynamic3DTextLabel("Vip Hq Exit",COLOR_LIGHTBLUE,VHq[id][VHQExPos][0],VHq[id][VHQExPos][1],VHq[id][VHQExPos][2]+0.3, 10);
- SendClientMessage(playerid, COLOR_RED, "Exit Is Now at Your Location");
- }
- return 1;
- }
- CMD:createvcar(playerid, params[])
- {
- new id, col[2], type;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "GTFO ON THE CAR N GET ON YOUR FEET -__-");
- if(sscanf(params, "iiii", id, col[0], col[1], type)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /createvcar [model] [color1] [color2] [level]");
- if(id < 400 || id > 611) return SendClientMessage(playerid, COLOR_RED, "Vehicles are between 400 and 611.");
- for(new cid=0; cid < MAX_VCARS; cid++)
- {
- if(!VCar[cid][VCreated])
- {
- new Float: X, Float: Y, Float: Z, Float: A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- VCar[cid][Model] = id;
- VCar[cid][CPos][0] = X;
- VCar[cid][CPos][1] = Y;
- VCar[cid][CPos][2] = Z;
- VCar[cid][CPos][3] = A;
- VCar[cid][Col][0] = col[0];
- VCar[cid][Col][1] = col[1];
- VCar[cid][VType] = type;
- VCar[cid][VCreated] = 1;
- VCar[cid][Car] = CreateVehicle(VCar[cid][Model], VCar[cid][CPos][0], VCar[cid][CPos][1], VCar[cid][CPos][2], VCar[cid][CPos][3], VCar[cid][Col][0], VCar[cid][Col][1], -1);
- cid = MAX_VCARS;
- }
- }
- return 1;
- }
- CMD:destroyvcar(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "RCON ADMINS ONLY");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Get into the vehicle of choice");
- for(new cid=0; cid < MAX_VCARS; cid++)
- {
- if(VCar[cid][VCreated])
- {
- if(GetPlayerVehicleID(playerid) == VCar[cid][Car])
- {
- VCar[cid][Model] = 0;
- VCar[cid][CPos][0] = 0;
- VCar[cid][CPos][1] = 0;
- VCar[cid][CPos][2] = 0;
- VCar[cid][CPos][3] = 0;
- VCar[cid][Col][0] = 0;
- VCar[cid][Col][1] = 0;
- VCar[cid][VType] = 0;
- VCar[cid][VCreated] = 0;
- DestroyVehicle(VCar[cid][Car]);
- cid = MAX_VCARS;
- }
- }
- }
- return 1;
- }
- CMD:gvshelp(playerid, params[])
- {
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_RED, "You Vip Is Not Activated");
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "/vaccount, /v, /tvchat, /vshop, /vradio,/vsradio, /vnick, /hq");
- }
- return 1;
- }
- CMD:vaccount(playerid, params[])
- {
- if(LoggedIn[playerid] == 1)
- {
- LoggedIn[playerid] = 0;
- SendClientMessage(playerid, COLOR_GREEN, "You Are already Logged On");
- }
- if(fexist(VipPath(playerid)))
- {
- INI_ParseFile(VipPath(playerid), "LoadVIPPass_%s", .bExtra = true, .extra = playerid);
- TogglePlayerControllable(playerid, 0 );
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Load Up Your Vip Account","Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Create Vip Account","Enter a Vip password for You Vip Account","Register","Quit");
- TogglePlayerControllable(playerid, 0 );
- }
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new string[128];
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "You Are Not A Vip");
- if(!VCSTATUS[playerid]) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Chat Is Off");
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /v [text]");
- format(string, 128, "VIP:[%s] says:%s ",VipAccount[playerid][VNickName],params);
- VipMessage(COLOR_YELLOW, string);
- return 1;
- }
- CMD:tvchat(playerid, params[])
- {
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "You Are Not A Vip");
- if(VCSTATUS[playerid])
- {
- VCSTATUS[playerid] = 0;
- SendClientMessage(playerid, COLOR_GREEN, "You Turn OFF The Vip Chat");
- }
- else if(!VCSTATUS[playerid])
- {
- VCSTATUS[playerid] = 1;
- SendClientMessage(playerid, COLOR_GREEN, "You Turn ON The Vip Chat");
- }
- return 1;
- }
- CMD:vshop(playerid, params[])
- {
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "You Are Not A Vip");
- for(new vs=0; vs < MAX_SHOPS; vs++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, VipShop[vs][VSPos][0], VipShop[vs][VSPos][1], VipShop[vs][VSPos][2]))
- {
- ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, "{0099FF}VIP SHOP", "{3333CC}Guns\n{6699FF}Skins", "Shop", "Leave");
- }
- }
- return 1;
- }
- CMD:vradio(playerid, params[])
- {
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "You Need To Be A Vip");
- if(GetPlayerGold(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "$1 Gold Per Use");
- ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_INPUT, "Enter Music", "Use .MP3 Format or working links", "Listen", "Cancel");
- return 1;
- }
- CMD:vsradio(playerid, params[])
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- CMD:vnick(playerid, params[])
- {
- if(!VipAccount[playerid][VipLevel] && !LoggedIn[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "You Need To Be A Vip");
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vnick [name]");
- format(VipAccount[playerid][VNickName], 32 , "%s", params);
- SendClientMessage(playerid, COLOR_WHITE, VipAccount[playerid][VNickName]);
- return 1;
- }
- CMD:hq(playerid, params[])
- {
- for(new hq=0; hq < MAX_HQS; hq++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, VHq[hq][VHQEnPos][0], VHq[hq][VHQEnPos][1], VHq[hq][VHQEnPos][2]))
- {
- SetPlayerPos(playerid, VHq[hq][VHQExPos][0], VHq[hq][VHQExPos][1], VHq[hq][VHQExPos][2]);
- SetPlayerInterior(playerid, VHq[hq][HqInterior]);
- SetPlayerVirtualWorld(playerid, 250+hq);
- }
- if(IsPlayerInRangeOfPoint(playerid, 5, VHq[hq][VHQExPos][0], VHq[hq][VHQExPos][1], VHq[hq][VHQExPos][2]))
- {
- SetPlayerPos(playerid, VHq[hq][VHQEnPos][0], VHq[hq][VHQEnPos][1], VHq[hq][VHQEnPos][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[256];
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return TogglePlayerControllable(playerid, 1 );
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(VipPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File, "Level",0);
- INI_WriteString(File, "NickName","");
- INI_WriteInt(File, "Gold",0);
- INI_Close(File);
- TogglePlayerControllable(playerid, 1 );
- LoggedIn[playerid] = 1;
- SendClientMessage(playerid, COLOR_RED, "You Are Now Registered");
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "gvah");
- }
- if(VipAccount[playerid][VipLevel])
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "gvshelp");
- }
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return TogglePlayerControllable(playerid, 1 );
- if( response )
- {
- if(udb_hash(inputtext) == VipAccount[playerid][Vpass])
- {
- INI_ParseFile(VipPath(playerid), "LoadVIP_%s", .bExtra = true, .extra = playerid);
- LoggedIn[playerid] = 1;
- SendClientMessage(playerid, COLOR_RED, "You Are Now Log In");
- TogglePlayerControllable(playerid, 1 );
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_GREEN, "CMD:[ADMIN]gvah");
- }
- if(VipAccount[playerid][VipLevel])
- {
- SendClientMessage(playerid, COLOR_RED, "CMD:[PLAYER]gvshelp");
- }
- format(string, 256, "Gold Balance: %d",VipAccount[playerid][VGold]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- case DIALOG_SHOP:
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerGold(playerid) < 5) return SendClientMessage(playerid, COLOR_RED, "Woomp Woomp Woomp You Can even afford Brass Knuckles");
- ShowPlayerDialog(playerid, DIALOG_WEAPONINPUT, DIALOG_STYLE_INPUT, "Weapons", "{9900FF}Choose You Weapon", "LoadUp", "Close");
- }
- if(listitem == 1)
- {
- ShowModelSelectionMenu(playerid, vskins, "Choose a Skin");
- }
- }
- return 1;
- }
- case DIALOG_WEAPONINPUT:
- {
- if(response)
- {
- pGun[playerid] = strval(inputtext);
- ShowPlayerDialog(playerid,DIALOG_AMMOINPUT, DIALOG_STYLE_INPUT, "Weapons", "How Much Ammo", "Rounds", "Cancel");
- }
- return 1;
- }
- case DIALOG_AMMOINPUT:
- {
- if(response)
- {
- pAmmo[playerid] = strval(inputtext);
- new g = 5*pGun[playerid]*10*pAmmo[playerid];
- if(GetPlayerGold(playerid) < g) return SendClientMessage(playerid, COLOR_GREEN, "You cannot afford the ammount");
- VipAccount[playerid][VGold] -= g;
- format(string, 256, "Gold Balance: %d",VipAccount[playerid][VGold]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GivePlayerWeapon(playerid,pGun[playerid] ,pAmmo[playerid]);
- pGun[playerid] = 0;
- pAmmo[playerid] = 0;
- }
- return 1;
- }
- case DIALOG_RADIO:
- {
- if(response)
- {
- format(string, 256, "%s", inputtext);
- PlayAudioStreamForPlayer(playerid, string);
- }
- return 1;
- }
- }
- return 1;
- }
- public OnPlayerModelSelection(playerid, response, listid, modelid)
- {
- if(listid == vskins)
- {
- if(response)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Skin Changed");
- SetPlayerSkin(playerid, modelid);
- VipAccount[playerid][VGold] -= 50;
- new string[256];
- format(string, 256, "Gold Balance: %d",VipAccount[playerid][VGold]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else SendClientMessage(playerid, COLOR_GREEN, "Canceled skin selection");
- return 1;
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Glad 2 Be Here VIP SYSTEM");
- print("--------------------------------------\n");
- LoadVShops();
- LoadVipHq();
- LoadVCars();
- vskins = LoadModelSelectionMenu("GVIP/vskin.txt");
- return 1;
- }
- public OnFilterScriptExit()
- {
- SaveVShops();
- SaveVipHq();
- SaveVCars();
- foreach(Player, i)
- if(LoggedIn[i] == 1)
- {
- LoggedIn[i] = 0;
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- VCSTATUS[playerid] = 1;
- LoggedIn[playerid] = 0;
- pGun[playerid] = 0;
- pAmmo[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(VipAccount[playerid][VipLevel] && LoggedIn[playerid])
- {
- new INI:File = INI_Open(VipPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File, "Password",VipAccount[playerid][Vpass]);
- INI_WriteInt(File, "Level",VipAccount[playerid][VipLevel]);
- INI_WriteString(File, "NickName",VipAccount[playerid][VNickName]);
- INI_WriteInt(File, "Gold",VipAccount[playerid][VGold]);
- INI_Close(File);
- }
- DeletePlayer3DTextLabel(playerid, vlabel);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- for(new c=0; c < MAX_VCARS; c++)
- {
- if(newstate == 2)
- {
- new CheckVipCar = GetPlayerVehicleID(playerid);
- if(CheckVipCar == VCar[c][Car])
- {
- if(VCar[c][VType] && !VipAccount[playerid][VipLevel])
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "This Car Is For Vip's");
- }
- else if(VCar[c][VType] == 2 && VipAccount[playerid][VipLevel] < 2)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "This Car Is For Silver Vip's");
- }
- else if(VCar[c][VType] == 3 && VipAccount[playerid][VipLevel] < 3)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "This Car Is For Gold Vip's");
- }
- else if(VCar[c][VType] == 4 && VipAccount[playerid][VipLevel] < 4)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "This Car Is For Platinum Vip's");
- }
- }
- }
- }
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment