Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #include <zcmd>
- #include <sscanf>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" VIP System");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- }
- #endif
- //COLOUR DEFINES
- #define COLOR_GREY 0xFFFFFFAA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_INFO2 0x99FFCCFF
- #define COLOR_SILVER 0xB5C9ECFF
- #define COLOR_INFO 0x649ED8FF
- #define COLOR_ADMIN 0x008FD6FF
- #define COLOR_GREEN 0xADFF2FAA
- #define COLOR_GOLDEN 0xFFFFCCFF
- #define COLOR_IGNORE 0xFF9966AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_SPAWN 0xFF6633AA
- #define COLOR_MOTOR 0x8E4848AA
- #define COLOR_MOTOR1 0xC28547AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DARKGOLD 0x808000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_DARKGREEN 0x12900BBF
- #define COLOR_BROWN1 0xFFFFFFAA
- #define COLOR_LIME 0x10F441AA
- #define COLOR_MAGENTA 0xFF00FFFF
- #define COLOR_NAVY 0x000080AA
- #define COLOR_AQUA 0xF0F8FFAA
- #define COLOR_CRIMSON 0xDC143CAA
- #define COLOR_FLBLUE 0x6495EDAA
- #define COLOR_BISQUE 0xFFE4C4AA
- #define COLOR_BLACK 0x000000AA
- #define COLOR_CHART 0x7FFF00AA
- #define COLOR_BROWN 0xFFFFFFAA
- #define COLOR_CORAL 0xFF643DAA
- #define COLOR_GOLD 0xB8860BAA
- #define COLOR_GYELLOW 0xADFF2FAA
- #define COLOR_INDIGO 0x4B00B0AA
- #define COLOR_IVORY 0xFFFF82AA
- #define COLOR_LAWNGREEN 0x7CFC00AA
- #define COLOR_SEAGREEN 0x15D5EAC8
- #define COLOR_LIMEGREEN 0x32CD32AA
- #define COLOR_MTBLUE 0x191970AA
- #define COLOR_MAROON 0x800000AA
- #define COLOR_OLIVE 0x808000AA
- #define COLOR_ORANGERED 0xFF4500AA
- #define COLOR_PINK 0xFFC0CBAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_YELLOW3 0xFFFF00FF
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_CYAN 0x40FFFFFF
- #define COLOR_YELLOW2 0xF5DEB3AA
- #define COLOR_PURPLE 0x800080FF
- //#define COLOR_SYSTEM 0xA9C4E4FF
- #define COLOR_SYSTEM 0xFFFF33AA
- #define LIGHTGREEN 0xFFFFE0FF
- #define red 0xFF0000FF
- #define green 0x00F20096
- #define COLOR_SAMP 0xA9C4E4FF
- #define COLOR_SYSTEM_PM 0x66CC00AA // LIGHT GREEN
- #define COLOR_SYSTEM_PW 0xFFFF33AA // YELLOW
- #define MAX_VIP_VEHS 100
- //news
- new VehicleNames[212][] = {
- {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
- {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
- {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
- {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
- {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
- {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
- {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
- {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
- {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
- {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
- {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
- {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
- {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
- {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
- {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
- {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
- {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
- {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
- {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
- {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
- {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
- {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
- {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
- {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
- {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
- {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
- {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
- {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
- {"Utility Trailer"}
- };
- new VipVeh[MAX_VIP_VEHS];
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetTimerEx("VIPCLOCK", 500, 1, "i", playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- //Set Vip Command:
- CMD:setvip(playerid, params[])
- {
- new months,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
- if(IsPlayerAdmin(playerid))//Is player is rcon administrator
- {
- if(sscanf(params,"ui",ID,months)) return SendClientMessage(playerid,0xFFFFFFAA, "Usage: /setvip [id] [months 0-12]");
- if(months > 12) return SendClientMessage(playerid,0xFF0000AA,"Error: Maximum months - 12");
- if(months < 0) return SendClientMessage(playerid,0xFF0000AA,"Error: Invalid Month!");
- if(!IsPlayerConnected(ID))return SendClientMessage(playerid,0xFF0000AA,"Error: Invalid player id!");
- new string[128];
- format(string,sizeof(string),"Error: That person already posses VIP Level 1.");
- if(dini_Int(pFile(ID),"VIP") == 1) return SendClientMessage(playerid,0xFF0000AA,string);
- GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
- GetPlayerName(ID,pname,MAX_PLAYER_NAME);
- if(months == 1)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (1 Month) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~1 Month VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (1 Month) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*30);
- }
- if(months == 2)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (2 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~2 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (2 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*60);
- }
- if(months == 3)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (3 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~3 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (3 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*90);
- }
- if(months == 4)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (4 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~4 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (4 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*120);
- }
- if(months == 5)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (5 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~5 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (5 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*150);
- }
- if(months == 6)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (6 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~6 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (6 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*180);
- }
- if(months == 7)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (7 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~7 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (7 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*210);
- }
- if(months == 8)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (8 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~8 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (8 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*240);
- }
- if(months == 9)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (9 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~9 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (9 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*270);
- }
- if(months == 10)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (10 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~10 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (10 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*300);
- }
- if(months == 11)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (11 Months) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~11 Months VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (11 Months) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*330);
- }
- if(months == 12)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (1 Year) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~1 Year VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package (1 Year) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*360);
- }
- if(months == 0)
- {
- SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package 1 (Life Time) Subscribtion.");
- GameTextForPlayer(ID, "Enjoy ~g~Unlimited VIP!", 3000, 5);
- SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
- format(str, sizeof(str),"You've given %s a VIP Package 1 (Life Time) subscription",pname);
- SendClientMessage(playerid,0xFFFFFFAA,str);
- dini_IntSet(pFile(ID),"VIP",1);
- dini_IntSet(pFile(ID),"VIPTIME",gettime()+60*60*24*1000);
- }
- }
- else return 0;
- return 1;
- }
- // Vip Commands
- CMD:vcmds(playerid, params[])
- {
- return cmd_vipcommands(playerid, params);
- }
- CMD:vipcommands(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- new str[200];
- if (dini_Int(pFile(playerid),"VIP") >= 1)
- {
- format(str,sizeof(str),"{FFFF00}VCMDS: {FFFFFF}/carcolor /changeskin /weather /veh /dvc /nos /vc /vpm /vrepair /vflip");
- SendClientMessage(playerid, 0xFFFFFFAA, str);
- }
- else return 0;
- }
- return 1;
- }
- CMD:carcolor(playerid,params[])
- {
- new color;
- new color2;
- new string[100];
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
- {
- if(sscanf(params,"ii",color,color2)) return SendClientMessage(playerid, -1, "Usage: /carcolor [color] [color2]");
- ChangeVehicleColor(GetPlayerVehicleID(playerid), color,color2);
- format(string, sizeof(string), "You have successfully changed your car color with %d and %d color ids",color,color2);
- SendClientMessage(playerid,0xFFFFFFAA, string);
- }else return SendClientMessage(playerid,-1,"ERROR: You must be in a vehicle.");
- }else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- CMD:changeskin(playerid, params[])
- {
- new skin;
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(sscanf(params,"i",skin)) return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /changeskin [SkinID]");
- SendClientMessage(playerid, -1, "You have successfully changed your skin.");
- SetPlayerSkin(playerid,skin);
- }
- else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- CMD:weather(playerid,params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- new id;
- if(sscanf(params,"d",id)) return
- SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /weather [WeatherID]");
- SetPlayerWeather(playerid, id);
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- SendClientMessage(playerid,-1,"Weather Successfully changed");
- }
- else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- CMD:veh(playerid, params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(dini_Int(pFile(playerid),"Activated")==1)
- {
- new veh[64], col1, col2, id, done;
- if(sscanf(params, "s", veh))
- {
- SendClientMessage(playerid, -1, "Usage: /veh [ModelID/Name]");
- return 1;
- }
- new string[128];
- if(!IsNumeric(veh))
- id = GetVehicleModelIDFromName(veh);
- else id = strval(veh);
- if(id < 400 || id > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model ID!");
- if(id == 425||id==520||id==432||id==447) return SendClientMessage(playerid, 0xFF0000AA, "These vehicles are restricted for spawn");
- col1 = random(126);
- col2 = random(126);
- new Float:X,Float:Y,Float:Z;
- new Float:Angle,int1;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid,Angle);
- for(new i=0; i<MAX_VIP_VEHS; i++)
- {
- if(!VipVeh[i])
- {
- VipVeh[i] = CreateVehicle(id, X+3,Y,Z, Angle, col1, col2, -1);
- LinkVehicleToInterior(VipVeh[i],int1);
- format(string, sizeof(string), "You have Spawned a %s (Model: %d) with Colours: %d,%d dont forget to destroy this vehicle with /dvc", VehicleNames[id-400], id, col1, col2);
- PutPlayerInVehicle(playerid, VipVeh[i], 0);
- done = 1;
- i = MAX_VIP_VEHS;
- }
- }
- if(!done) format(string, sizeof(string), "There are no vehicle slots left.");
- return SendClientMessage(playerid,COLOR_SYSTEM, string);
- }
- else
- {
- SendClientMessage(playerid,COLOR_RED,"Error: You'r VIP is package not activated please use /account to activate your subscription");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You are not VIP member");
- }
- return 1;
- }
- CMD:dvc(playerid,params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid), done;
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- for(new i; i<MAX_VIP_VEHS; i++)
- {
- if(vehicleid == VipVeh[i])
- {
- DestroyVehicle(VipVeh[i]);
- VipVeh[i] = 0;
- i = MAX_VIP_VEHS;
- SendClientMessage(playerid,-1,"You've successfully Destroyed This car");
- done = 1;
- }
- }
- if(!done) SendClientMessage(playerid,-1,"You can't destroy this car.");
- }
- else
- {
- SendClientMessage(playerid,red,"Error: You must sit in the Car before using this command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You are not VIP member");
- }
- return 1;
- }
- CMD:nos(playerid,params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
- {
- case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
- return SendClientMessage(playerid,-1,"ERROR: You can not tune this vehicle!");
- }
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
- }else return SendClientMessage(playerid,-1,"ERROR: You must be in a vehicle.");
- }
- else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- forward SendVIPMessage(color, string[]);
- public SendVIPMessage(color, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(dini_Int(pFile(i),"VIP") >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- }
- CMD:vc(playerid, params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- new Nam[MAX_PLAYERS],message[128],str[256];
- if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /vc(vip Chat) [Text]");
- GetPlayerName(playerid,Nam,sizeof(Nam));
- format(str,sizeof(str),"{9900CC}VIP Chat %s: {FFFFFF}%s",Nam,message);
- if (dini_Int(pFile(playerid),"VIP") == 1)
- {
- SendVIPMessage(COLOR_PURPLE, str);
- return 1;
- }
- }
- else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- CMD:vpm(playerid, params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
- if(sscanf(params, "us", id, str2))
- {
- SendClientMessage(playerid, 0xFF0000FF, "Usage: /vpm <id> <message>");
- return 1;
- }
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "[V-I-P] PM To %s(ID %d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str, sizeof(str), "[V-I-P] PM From %s(ID %d): %s", Name1, playerid, str2);
- SendClientMessage(id, COLOR_YELLOW, str);
- }
- else return SendClientMessage(playerid, 0xFFFF00AA, "This Command is For VIP Package 1 Donate $3 to get this Command.");
- return 1;
- }
- CMD:vips(playerid,params[])
- {
- new count = 0;
- new string[128],name[50];
- new name1[MAX_PLAYER_NAME];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- GetPlayerName(i,name1,MAX_PLAYER_NAME);
- if(dini_Int(pFile(playerid),"VIP") >= 0)
- {
- if(dini_Int(pFile(i),"VIP") == 1)
- {name = "Server VIP";}
- format(string, 128, "\"%s\" {%s}", name1,name);
- SendClientMessage(playerid, COLOR_WHITE, string);
- count++;
- }
- }
- }
- if (count == 0)
- SendClientMessage(playerid,COLOR_GREY,"There are no VIPS Online at the moment");
- return 1;
- }
- //Timer for check VIP time of a player
- forward VIPCLOCK();
- public VIPCLOCK()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(dini_Int(pFile(i),"VIP") > 0)
- {
- if(IsPlayerConnected(i))
- {
- if(gettime() > dini_Int(pFile(i),"VIPTIME"))
- {
- dini_IntSet(pFile(i),"VIP", 0);
- dini_IntSet(pFile(i),"VIPTIME",0);
- SendClientMessage(i,0xFF9900AA,"Your VIP Subscribtion has been ended.");
- GameTextForPlayer(i, "Thanks for donating!", 3000, 5);
- SendClientMessage(i,0xFFFFFFAA,"We're hoping you enjoyed being V.I.P"); }
- }
- }
- }
- return 1;
- }
- CMD:vrepair(playerid,params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
- {
- new VehicleID = GetPlayerVehicleID(playerid);
- RepairVehicle(VehicleID);
- GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~Vehicle ~g~Repaired!",3000,3);
- SetVehicleHealth(VehicleID, 1000);
- }
- else return SendClientMessage(playerid,COLOR_RED,"Error: You are not driver!");
- }
- else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
- return 1;
- }
- CMD:vflip(playerid,params[])
- {
- if(dini_Int(pFile(playerid),"VIP") >= 1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle;
- GetPlayerPos(playerid, X, Y, Z);
- VehicleID = GetPlayerVehicleID(playerid);
- GetVehicleZAngle(VehicleID, Angle);
- SetVehiclePos(VehicleID, X, Y, Z);
- SetVehicleZAngle(VehicleID, Angle);
- SetVehicleHealth(VehicleID,1000.0);
- SendClientMessage(playerid, COLOR_GREEN,"Vehicle Flipped!");
- }
- else return SendClientMessage(playerid,red,"ERROR: You are not in a Vehicle!");
- }
- else return 0;
- return 1;
- }
- CMD:removevip(playerid, params[])
- {
- new levels,pname[MAX_PLAYER_NAME],str[128],ID;
- if(IsPlayerAdmin(playerid))//Is player rcon administrator
- {
- if(sscanf(params,"u",ID)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /removevip [playerid]");
- if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"That user is not connected.");
- if(dini_Int(pFile(ID),"VIP") == 0) return SendClientMessage(playerid,COLOR_RED,"Error: That player is not a VIP!");
- GetPlayerName(ID,pname,MAX_PLAYER_NAME);
- format(str, sizeof(str),"An Admin has removed your VIP Package.");
- SendClientMessage(ID,COLOR_ORANGE,str);
- format(str, sizeof(str),"You have removed %s's VIP Package!",pname,levels);
- SendClientMessage(playerid,COLOR_YELLOW,str);
- dini_IntSet(pFile(ID),"VIP", 0);
- dini_IntSet(pFile(ID),"VIPTIME",0);
- }else return 0;
- return 1;
- }
- stock GetVehicleName(vehicleid)//GetVehicleName
- {
- new String[100];
- format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
- return String;
- }
- stock GetVehicleModelIDFromName(vname[]) // GetVehicleNameById
- {
- for(new i = 0; i < 211; i++)
- {
- if ( strfind(VehicleNames[i], vname, true) != -1 )
- return i + 400;
- }
- return -1;
- }
- stock IsNumeric(const str[])//stock for check numeric values
- {
- for(new i, len = strlen(str); i < len; i++)
- {
- if(!('0' <= str[i] <= '9')) return false;
- }
- return true;
- }
- stock RPN(playerid)//Getplayername stock
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock pFile(playerid)//UserFile path
- {
- new file[64];
- format(file, sizeof(file), "Accounts/%s.ini",RPN(playerid)); // You can change it to what is your users's path
- return file;
- }
Advertisement
Add Comment
Please, Sign In to add comment