Advertisement
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 <a_objects>
- #include <a_players>
- #include <a_vehicles>
- #include <YSI\y_commands>
- #include <YSI\y_ini>
- #include <file>
- #include <sscanf2>
- #define COLOR_ACTIVEBORDER 0xB4B4B4FF
- #define COLOR_ACTIVECAPTION 0x99B4D1FF
- #define COLOR_ACTIVECAPTIONTEXT 0x000000FF
- #define COLOR_ALICEBLUE 0xF0F8FFFF
- #define COLOR_ANTIQUEWHITE 0xFAEBD7FF
- #define COLOR_APPWORKSPACE 0xABABABFF
- #define COLOR_AQUA 0x00FFFFFF
- #define COLOR_AQUAMARINE 0x7FFFD4FF
- #define COLOR_AZURE 0xF0FFFFFF
- #define COLOR_BEIGE 0xF5F5DCFF
- #define COLOR_BISQUE 0xFFE4C4FF
- #define COLOR_BLACK 0x000000FF
- #define COLOR_BLANCHEDALMOND 0xFFEBCDFF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_BLUEVIOLET 0x8A2BE2FF
- #define COLOR_BROWN 0xA52A2AFF
- #define COLOR_BURLYWOOD 0xDEB887FF
- #define COLOR_BUTTONFACE 0xF0F0F0FF
- #define COLOR_BUTTONHIGHLIGHT 0xFFFFFFFF
- #define COLOR_BUTTONSHADOW 0xA0A0A0FF
- #define COLOR_CADETBLUE 0x5F9EA0FF
- #define COLOR_CHARTREUSE 0x7FFF00FF
- #define COLOR_CHOCOLATE 0xD2691EFF
- #define COLOR_CONTROL 0xF0F0F0FF
- #define COLOR_CONTROLDARK 0xA0A0A0FF
- #define COLOR_CONTROLDARKDARK 0x696969FF
- #define COLOR_CONTROLLIGHT 0xE3E3E3FF
- #define COLOR_CONTROLLIGHTLIGHT 0xFFFFFFFF
- #define COLOR_CONTROLTEXT 0x000000FF
- #define COLOR_CORAL 0xFF7F50FF
- #define COLOR_CORNFLOWERBLUE 0x6495EDFF
- #define COLOR_CORNSILK 0xFFF8DCFF
- #define COLOR_CRIMSON 0xDC143CFF
- #define COLOR_CYAN 0x00FFFFFF
- #define COLOR_DARKBLUE 0x00008BFF
- #define COLOR_DARKCYAN 0x008B8BFF
- #define COLOR_DARKGOLDENROD 0xB8860BFF
- #define COLOR_DARKGRAY 0xA9A9A9FF
- #define COLOR_DARKGREEN 0x006400FF
- #define COLOR_DARKKHAKI 0xBDB76BFF
- #define COLOR_DARKMAGENTA 0x8B008BFF
- #define COLOR_DARKOLIVEGREEN 0x556B2FFF
- #define COLOR_DARKORANGE 0xFF8C00FF
- #define COLOR_DARKORCHID 0x9932CCFF
- #define COLOR_DARKRED 0x8B0000FF
- #define COLOR_DARKSALMON 0xE9967AFF
- #define COLOR_DARKSEAGREEN 0x8FBC8BFF
- #define COLOR_DARKSLATEBLUE 0x483D8BFF
- #define COLOR_DARKSLATEGRAY 0x2F4F4FFF
- #define COLOR_DARKTURQUOISE 0x00CED1FF
- #define COLOR_DARKVIOLET 0x9400D3FF
- #define COLOR_DEEPPINK 0xFF1493FF
- #define COLOR_DEEPSKYBLUE 0x00BFFFFF
- #define COLOR_DESKTOP 0x000000FF
- #define COLOR_DIMGRAY 0x696969FF
- #define COLOR_DODGERBLUE 0x1E90FFFF
- #define COLOR_FIREBRICK 0xB22222FF
- #define COLOR_FLORALWHITE 0xFFFAF0FF
- #define COLOR_FORESTGREEN 0x228B22FF
- #define COLOR_FUCHSIA 0xFF00FFFF
- #define COLOR_GAINSBORO 0xDCDCDCFF
- #define COLOR_GHOSTWHITE 0xF8F8FFFF
- #define COLOR_GOLD 0xFFD700FF
- #define COLOR_GOLDENROD 0xDAA520FF
- #define COLOR_GRADIENTACTIVECAPTION 0xB9D1EAFF
- #define COLOR_GRADIENTINACTIVECAPTION 0xD7E4F2FF
- #define COLOR_GRAY 0x808080FF
- #define COLOR_GRAYTEXT 0x808080FF
- #define COLOR_GREEN 0x008000FF
- #define COLOR_GREENYELLOW 0xADFF2FFF
- #define COLOR_HIGHLIGHT 0x3399FFFF
- #define COLOR_HIGHLIGHTTEXT 0xFFFFFFFF
- #define COLOR_HONEYDEW 0xF0FFF0FF
- #define COLOR_HOTPINK 0xFF69B4FF
- #define COLOR_HOTTRACK 0x0066CCFF
- #define COLOR_INACTIVEBORDER 0xF4F7FCFF
- #define COLOR_INACTIVECAPTION 0xBFCDDBFF
- #define COLOR_INACTIVECAPTIONTEXT 0x434E54FF
- #define COLOR_INDIANRED 0xCD5C5CFF
- #define COLOR_INDIGO 0x4B0082FF
- #define COLOR_INFO 0xFFFFE1FF
- #define COLOR_INFOTEXT 0x000000FF
- #define COLOR_IVORY 0xFFFFF0FF
- #define COLOR_KHAKI 0xF0E68CFF
- #define COLOR_LAVENDER 0xE6E6FAFF
- #define COLOR_LAVENDERBLUSH 0xFFF0F5FF
- #define COLOR_LAWNGREEN 0x7CFC00FF
- #define COLOR_LEMONCHIFFON 0xFFFACDFF
- #define COLOR_LIGHTBLUE 0xADD8E6FF
- #define COLOR_LIGHTCORAL 0xF08080FF
- #define COLOR_LIGHTCYAN 0xE0FFFFFF
- #define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
- #define COLOR_LIGHTGRAY 0xD3D3D3FF
- #define COLOR_LIGHTGREEN 0x90EE90FF
- #define COLOR_LIGHTPINK 0xFFB6C1FF
- #define COLOR_LIGHTSALMON 0xFFA07AFF
- #define COLOR_LIGHTSEAGREEN 0x20B2AAFF
- #define COLOR_LIGHTSKYBLUE 0x87CEFAFF
- #define COLOR_LIGHTSLATEGRAY 0x778899FF
- #define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
- #define COLOR_LIGHTYELLOW 0xFFFFE0FF
- #define COLOR_LIME 0x00FF00FF
- #define COLOR_LIMEGREEN 0x32CD32FF
- #define COLOR_LINEN 0xFAF0E6FF
- #define COLOR_MAGENTA 0xFF00FFFF
- #define COLOR_MAROON 0x800000FF
- #define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
- #define COLOR_MEDIUMBLUE 0x0000CDFF
- #define COLOR_MEDIUMORCHID 0xBA55D3FF
- #define COLOR_MEDIUMPURPLE 0x9370DBFF
- #define COLOR_MEDIUMSEAGREEN 0x3CB371FF
- #define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
- #define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
- #define COLOR_MEDIUMTURQUOISE 0x48D1CCFF
- #define COLOR_MEDIUMVIOLETRED 0xC71585FF
- #define COLOR_MENU 0xF0F0F0FF
- #define COLOR_MENUBAR 0xF0F0F0FF
- #define COLOR_MENUHIGHLIGHT 0x3399FFFF
- #define COLOR_MENUTEXT 0x000000FF
- #define COLOR_MIDNIGHTBLUE 0x191970FF
- #define COLOR_MINTCREAM 0xF5FFFAFF
- #define COLOR_MISTYROSE 0xFFE4E1FF
- #define COLOR_MOCCASIN 0xFFE4B5FF
- #define COLOR_NAVAJOWHITE 0xFFDEADFF
- #define COLOR_NAVY 0x000080FF
- #define COLOR_OLDLACE 0xFDF5E6FF
- #define COLOR_OLIVE 0x808000FF
- #define COLOR_OLIVEDRAB 0x6B8E23FF
- #define COLOR_ORANGE 0xFFA500FF
- #define COLOR_ORANGERED 0xFF4500FF
- #define COLOR_ORCHID 0xDA70D6FF
- #define COLOR_PALEGOLDENROD 0xEEE8AAFF
- #define COLOR_PALEGREEN 0x98FB98FF
- #define COLOR_PALETURQUOISE 0xAFEEEEFF
- #define COLOR_PALEVIOLETRED 0xDB7093FF
- #define COLOR_PAPAYAWHIP 0xFFEFD5FF
- #define COLOR_PEACHPUFF 0xFFDAB9FF
- #define COLOR_PERU 0xCD853FFF
- #define COLOR_PINK 0xFFC0CBFF
- #define COLOR_PLUM 0xDDA0DDFF
- #define COLOR_POWDERBLUE 0xB0E0E6FF
- #define COLOR_PURPLE 0x800080FF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_ROSYBROWN 0xBC8F8FFF
- #define COLOR_ROYALBLUE 0x4169E1FF
- #define COLOR_SADDLEBROWN 0x8B4513FF
- #define COLOR_SALMON 0xFA8072FF
- #define COLOR_SANDYBROWN 0xF4A460FF
- #define COLOR_SCROLLBAR 0xC8C8C8FF
- #define COLOR_SEAGREEN 0x2E8B57FF
- #define COLOR_SEASHELL 0xFFF5EEFF
- #define COLOR_SIENNA 0xA0522DFF
- #define COLOR_SILVER 0xC0C0C0FF
- #define COLOR_SKYBLUE 0x87CEEBFF
- #define COLOR_SLATEBLUE 0x6A5ACDFF
- #define COLOR_SLATEGRAY 0x708090FF
- #define COLOR_SNOW 0xFFFAFAFF
- #define COLOR_SPRINGGREEN 0x00FF7FFF
- #define COLOR_STEELBLUE 0x4682B4FF
- #define COLOR_TAN 0xD2B48CFF
- #define COLOR_TEAL 0x008080FF
- #define COLOR_THISTLE 0xD8BFD8FF
- #define COLOR_TOMATO 0xFF6347FF
- #define COLOR_TRANSPARENT 0xFFFFFF00
- #define COLOR_TURQUOISE 0x40E0D0FF
- #define COLOR_VIOLET 0xEE82EEFF
- #define COLOR_WHEAT 0xF5DEB3FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_WHITESMOKE 0xF5F5F5FF
- #define COLOR_WINDOW 0xFFFFFFFF
- #define COLOR_WINDOWFRAME 0x646464FF
- #define COLOR_WINDOWTEXT 0x000000FF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_YELLOWGREEN 0x9ACD32FF
- #define STEALTH_ORANGE 0xFF880000
- #define STEALTH_OLIVE 0x66660000
- #define STEALTH_GREEN 0x33DD1100
- #define STEALTH_PINK 0xFF22EE00
- #define STEALTH_BLUE 0x0077BB00
- #define INT_CONSOLE "{7EBA1E}"
- #define INT_SILVER "{E5EBDD}"
- #define INT_YELLOW "{F2E41D}"
- #define INT_RED "{EB1010}"
- //---------------------------------------------------------------------------------------------------------START CHECKING CAR
- new VehicleNames[][] =
- {
- "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
- "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
- "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
- "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
- "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
- "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
- "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
- "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "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", "Cropduster", "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", "Hustler", "Intruder", "Primo",
- "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
- "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
- "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
- "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
- "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
- "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
- "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
- "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
- "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
- "Tiller", "Utility Trailer"
- };
- stock GetVehicleName(vehicleid)
- {
- new vname[128];
- format(vname, sizeof(vname),"%s",VehicleNames[vehicleid - 400]);
- return vname;
- }
- //---------------------------------------------------------------------------------------------------------END CHECKING CAR
- new ValidCivilianSkins [ ] =
- {
- 1, 2, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 121, 122, 128, 129, 131, 132, 133, 134, 135, 136, 137,
- 138, 139, 140, 141, 142, 143, 145, 146, 147, 148, 150, 151, 152, 153,
- 154, 155, 156, 157, 158, 159, 160, 161, 162, 167, 168, 169, 170, 171,
- 172, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
- 191, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
- 207, 208, 209, 210, 212, 213, 214, 215, 216, 218, 219, 220, 221, 222,
- 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 249, 250, 251, 252,
- 253, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 290, 291, 292,
- 293, 296, 297, 298, 299
- };
- new ooc = 0;
- enum cVars
- {
- Name[128],
- Password[128],
- Admin,
- Skin,
- Money,
- Float: LastX,
- Float: LastY,
- Float: LastZ,
- Float: LastA
- }
- enum
- {
- DIALOG_NEWPLAYER,
- DIALOG_EXISTINGPLAYER,
- DIALOG_EXISTINGPLAYER_INV
- }
- new pInfo[MAX_PLAYERS][cVars];
- //user config stuff
- forward LoadPlayer_info ( playerid, name[], value[] );
- public LoadPlayer_info ( playerid, name[], value[] )
- {
- INI_String("name", pInfo[playerid][Name], 128);
- INI_String("password", pInfo[playerid][Password], 128);
- INI_Int("admin", pInfo[playerid][Admin]);
- INI_Int("money", pInfo[playerid][Money]);
- INI_Int("skin", pInfo[playerid][Skin]);
- INI_Float("locx", pInfo[playerid][LastX]);
- INI_Float("locy", pInfo[playerid][LastY]);
- INI_Float("locz", pInfo[playerid][LastZ]);
- INI_Float("locr", pInfo[playerid][LastA]);
- return true;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Nate's RP");
- LimitGlobalChatRadius(200.0); // Global Chat Radius
- //add vehicles
- AddStaticVehicle(596,2037.8000500,1343.5999800,10.5000000,0.0000000,0,3); //Police Car (LSPD)
- AddStaticVehicle(490,2037.9000200,1335.4000200,11.0000000,0.0000000,0,3); //FBI Rancher
- AddStaticVehicle(514,2037.8000500,1325.8000500,11.4000000,0.0000000,3,3); //Tanker
- AddStaticVehicle(584,2037.9000200,1309.5999800,11.8000000,0.0000000,245,245); //Trailer 3
- AddStaticVehicle(596,2036.5000000,1350.5000000,10.6000000,0.0000000,0,44); //Police Car (LSPD)
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- /*SetPlayerPos(playerid, 1956.705810, 1343.167846, 15.374607);
- SetPlayerFacingAngle(playerid, 269.020812);
- SetPlayerCameraLookAt(playerid, 1956.705810, 1343.167846, 15.374607);*/
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new userStr [ 64 ];
- new plName [ MAX_PLAYER_NAME ];
- GetPlayerName(playerid, plName, MAX_PLAYER_NAME); // Get the players name
- format ( userStr, 64, "users/%s.ini", plName ); // Format the directory for their file
- if( fexist ( userStr ) ) // If their file exists...
- {
- // Load it and show them a login box(?)
- //ShowPlayerDialog ( playerid, ...
- INI_ParseFile ( userStr, "LoadPlayer_%s", .bExtra = true, .extra = playerid ); // Load their info you just created.
- ShowDialog(playerid, DIALOG_EXISTINGPLAYER);
- /*SetSpawnInfo(playerid, 0, pInfo[playerid][Skin], pInfo[playerid][LastX], pInfo[playerid][LastY], pInfo[playerid][LastZ], pInfo[playerid][LastA], 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, pInfo[playerid][Money]);*/
- }
- else // They don't exist..
- {
- ShowDialog(playerid, DIALOG_NEWPLAYER);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(IsPlayerInAnyVehicle(playerid)){
- RemovePlayerFromVehicle(playerid);
- }
- //---------------------------------------------------------------------------------------------SAVE STATS
- new userStr [ 64 ];
- new plName [ MAX_PLAYER_NAME ];
- GetPlayerName(playerid, plName, MAX_PLAYER_NAME); // Get the players name
- format ( userStr, 64, "users/%s.ini", plName ); // Format the directory for their file
- new
- Float:newX,
- Float:newY,
- Float:newZ,
- Float:newR;
- GetPlayerPos(playerid, newX, newY, newZ);
- GetPlayerFacingAngle(playerid, newR);
- new
- INI: myFile = INI_Open ( userStr );
- INI_SetTag ( myFile, "info" );
- INI_WriteInt(myFile, "money", pInfo[playerid][Money]);
- INI_WriteInt(myFile, "skin", pInfo[playerid][Skin]);
- INI_WriteFloat(myFile, "locx", newX);
- INI_WriteFloat(myFile, "locy", newY);
- INI_WriteFloat(myFile, "locz", newZ);
- INI_WriteFloat(myFile, "locr", newR);
- INI_Close ( myFile );
- //---------------------------------------------------------------------------------------------SAVE STATS
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerControllable ( playerid, true );
- SetCameraBehindPlayer(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[])
- {
- switch ( dialogid )
- {
- case DIALOG_NEWPLAYER:
- {
- new userStr [ 64 ];
- new plName [ MAX_PLAYER_NAME ];
- new rand = random(sizeof(ValidCivilianSkins));
- GetPlayerName(playerid, plName, MAX_PLAYER_NAME); // Get the players name
- format ( userStr, 64, "users/%s.ini", plName ); // Format the directory for their file
- new
- INI: myFile = INI_Open ( userStr );
- INI_SetTag ( myFile, "info" );
- // Variables for a newly registered person
- INI_WriteString(myFile, "name", plName);
- INI_WriteString(myFile, "password", inputtext);
- INI_WriteInt(myFile, "admin", 1);
- INI_WriteInt(myFile, "money", 696969);
- INI_WriteInt(myFile, "skin", ValidCivilianSkins[rand]);
- INI_WriteFloat(myFile, "locx", 1958.3783);
- INI_WriteFloat(myFile, "locy", 1343.1572);
- INI_WriteFloat(myFile, "locz", 15.3746);
- INI_WriteFloat(myFile, "locr", 269.1425);
- INI_Close ( myFile );
- INI_ParseFile ( userStr, "LoadPlayer_%s", .bExtra = true, .extra = playerid ); // Load their info you just created.
- SetSpawnInfo(playerid, 0, pInfo[playerid][Skin], pInfo[playerid][LastX], pInfo[playerid][LastY], pInfo[playerid][LastZ], pInfo[playerid][LastA], 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, pInfo[playerid][Money]);
- new Welcome[128];
- format(Welcome, sizeof(Welcome), "Thankyou for registering, %s! Your password is: (%s)", plName, pInfo[playerid][Password]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, Welcome);
- }
- case DIALOG_EXISTINGPLAYER:
- {
- if ( !response )
- {
- // Not their account!
- }
- if( strcmp(pInfo[playerid][Password], inputtext, false ) == 0 && !isnull ( inputtext ) )
- {
- SetSpawnInfo(playerid, 0, pInfo[playerid][Skin], pInfo[playerid][LastX], pInfo[playerid][LastY], pInfo[playerid][LastZ], pInfo[playerid][LastA], 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, pInfo[playerid][Money]);
- new welcome[128];
- format(welcome, sizeof(welcome), "Welcome back, %s", pInfo[playerid][Name]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, welcome);
- if(pInfo[playerid][Admin] > 1){
- new adminm[128];
- format(adminm, sizeof(adminm), "Admin level: %i", pInfo[playerid][Admin]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, adminm);
- }
- new test[128];
- format(test, sizeof(test), "Your Skin is: %i", pInfo[playerid][Skin]);
- SendClientMessage(playerid, COLOR_LIMEGREEN, test);
- } else {
- new errorstring[128];
- format(errorstring, sizeof(errorstring), "%s tried to logon using the wrong password!", pInfo[playerid][Name]);
- SendClientMessageToAll(COLOR_LIGHTPINK, errorstring);
- ShowDialog(playerid, DIALOG_EXISTINGPLAYER_INV);
- }
- }
- }
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- /*
- ===================================================================================
- ===============================DIALOGS=====HERE====================================
- ===================================================================================
- */
- stock ShowDialog ( playerid, dialogid )
- {
- switch ( dialogid )
- {
- case DIALOG_NEWPLAYER:
- {
- ShowPlayerDialog ( playerid, DIALOG_NEWPLAYER, DIALOG_STYLE_PASSWORD, ""#INT_CONSOLE"Please enter a password..", ""#INT_SILVER"Our records show that you haven't played on our server before./n/nEnter a password below begin!", "OK", "" );
- }
- case DIALOG_EXISTINGPLAYER:
- {
- ShowPlayerDialog ( playerid, DIALOG_EXISTINGPLAYER, DIALOG_STYLE_PASSWORD, ""#INT_CONSOLE"Please enter your password..", ""#INT_SILVER"Welcome back! Please enter your unique password to be/n/nplaced where you left off", "OK", "Not Me" );
- }
- case DIALOG_EXISTINGPLAYER_INV:
- {
- ShowPlayerDialog ( playerid, DIALOG_EXISTINGPLAYER, DIALOG_STYLE_PASSWORD, ""#INT_CONSOLE"Please enter your password..", ""#INT_RED"** You have entered an invalid password!\n\n"#INT_SILVER"Welcome back! Please enter your unique password to be/n/nplaced where you left off", "OK", "Not Me" );
- }
- }
- return true;
- }
- //RP COMMANDS----------------------------------------
- CMD:ooc(playerid, params[])
- {
- //check if OOC is enalbed
- if(ooc == 1){
- new string[128];
- new name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /ooc [message]");
- format(string, sizeof(string), "((OOC: %s: %s))", name, params);
- SendClientMessageToAll(-1, string);
- } else if (ooc == 0) {
- SendClientMessage(playerid, -1, "((OOC CHAT DISABLED BY ADMIN))");
- return 1;
- }
- return 1;
- }
- CMD:newb(playerid, params[])
- {
- new string[128];
- new name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /newb [question]");
- format(string, sizeof(string), "((NEWB: %s: %s))", name, params);
- SendClientMessageToAll(COLOR_LIGHTBLUE, string);
- return 1;
- }
- CMD:help(playerid, params[])
- {
- if(isnull(params)){
- SendClientMessage(playerid, COLOR_RED, "_________________HELP_________________");
- SendClientMessage(playerid, COLOR_YELLOW, "Regular Commands: /help /ooc /me /carkick");
- if(pInfo[playerid][Admin] > 1){
- SendClientMessage(playerid, COLOR_FUCHSIA, "Admin Commands: /am /aho /ahc /lvo /lvc /lso /lsc /ts");
- SendClientMessage(playerid, COLOR_FUCHSIA, "Admin Commands: /togooc /v /giveskin");
- }
- SendClientMessage(playerid, COLOR_RED, "______________________________________");
- }
- return 1;
- }
- CMD:me(playerid, params[])
- {
- new string[128];
- new name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /me [action]");
- format(string, sizeof(string), "* %s %s.", name, params);
- SendClientMessageToAll(0xFF6363FF, string);
- return 1;
- }
- CMD:w(playerid, params[])
- {
- new
- message[128],
- id,
- szPlayerName[MAX_PLAYER_NAME],
- szMessage[128];
- if(sscanf(params, "us[128]", id, message)) {
- SendClientMessage(playerid, -1, "USAGE: /w [playerid] [message]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(playerid != id)
- {
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "Whisper from %s: %s", szPlayerName, message);
- SendClientMessage(id, -1, szMessage);
- GetPlayerName(id, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "Whisper sent to %s: %s", szPlayerName, message);
- SendClientMessage(playerid, -1, szMessage);
- }
- else
- {
- SendClientMessage(playerid, -1, "You cannot whisper to yourself!");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "The specified player ID is either not connected or has not authenticated.");
- }
- }
- return 1;
- }
- CMD:carkick(playerid, params[])
- {
- new
- kickid,
- carid,
- kickcarid;
- new kickname[MAX_PLAYER_NAME];
- new hostname[MAX_PLAYER_NAME];
- if(IsPlayerInAnyVehicle(playerid)){
- if(GetPlayerState(playerid) == 2){
- if(!sscanf(params, "i", kickid)) {
- if(kickid != playerid){
- if(IsPlayerInAnyVehicle(kickid)){
- carid = GetPlayerVehicleID(playerid);
- kickcarid = GetPlayerVehicleID(kickid);
- if(carid == kickcarid){
- GetPlayerName(kickid, kickname, MAX_PLAYER_NAME);
- GetPlayerName(playerid, hostname, MAX_PLAYER_NAME);
- //kick player
- new messagetohost[128];
- new messagetokick[128];
- format(messagetohost, sizeof(messagetohost), "%s has been kicked from your car!", kickname);
- format(messagetokick, sizeof(messagetokick), "%s has kicked you from their car!", hostname);
- SendClientMessage(playerid, COLOR_LIGHTPINK, messagetohost);
- SendClientMessage(kickid, COLOR_LIGHTPINK, messagetokick);
- RemovePlayerFromVehicle(kickid);
- return true;
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: That player isn't in your vehicle!");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: That player isn't in your vehicle!");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: You can't kick yourself!");
- }
- } else {
- SendClientMessage(playerid, -1, "USAGE: /carkick [id]");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: You must be the driver to perform '/carkick'");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: You must be in a vehicle to perform '/carkick'");
- }
- return 1;
- }
- //ADMIN COMMANDS--------------------------------------
- CMD:am(playerid, params[])
- {
- if(pInfo[playerid][Admin] > 1){
- new string[128];
- new name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /am [message]");
- format(string, sizeof(string), "(ADMIN) %s says %s", name, params);
- SendClientMessageToAll(COLOR_PINK, string);
- return 1;
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- return 1;
- }
- }
- CMD:ts(playerid, params[])
- {
- if(pInfo[playerid][Admin] > 1){
- SendClientMessageToAll(COLOR_LIMEGREEN, "TeamSpeak Server: 127.0.0.1");
- return 1;
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- return 1;
- }
- }
- CMD:togooc(playerid, params[])
- {
- if(pInfo[playerid][Admin] > 1){
- new
- aname[28],
- ooctogm[128];
- GetPlayerName(playerid, aname, sizeof(aname));
- if(ooc == 1){
- ooc = 0;
- format(ooctogm, sizeof(ooctogm), "(Info): The global OOC chat has been disabled by %s", aname);
- SendClientMessageToAll(COLOR_LIGHTPINK, ooctogm);
- return 1;
- } else if(ooc == 0){
- ooc = 1;
- format(ooctogm, sizeof(ooctogm), "(Info): The global OOC chat has been enabled by %s", aname);
- SendClientMessageToAll(COLOR_LIGHTPINK, ooctogm);
- return 1;
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- return 1;
- }
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new
- toid,
- carid,
- color1,
- color2;
- if(pInfo[playerid][Admin] > 1){
- if(!sscanf(params, "iiii", toid, carid, color1, color2)) {
- if(IsPlayerConnected(toid)){
- if(carid >399 && carid < 612){
- new
- Float: curX,
- Float: curY,
- Float: curZ,
- Float: curR;
- GetPlayerPos(toid, curX, curY, curZ);
- GetPlayerFacingAngle(playerid, curR);
- CreateVehicle(carid, curX+1, curY+1, curZ, curR, color1, color2, -1);
- new MessageToSender[128];
- new MessageToReciever[128];
- new SenderName[25];
- new RecieverName[25];
- GetPlayerName(playerid, SenderName, 18);
- GetPlayerName(toid, RecieverName, 18);
- format(MessageToSender, sizeof(MessageToSender), "Car '%s' sent to %s.", GetVehicleName(carid), RecieverName);
- format(MessageToReciever, sizeof(MessageToReciever), "%s has just spawned you a car (%s).", SenderName, GetVehicleName(carid));
- SendClientMessage(playerid, COLOR_LIGHTPINK, MessageToSender);
- SendClientMessage(toid, COLOR_LIGHTPINK, MessageToReciever);
- return true;
- } else {
- new errorstring[128];
- format(errorstring, sizeof(errorstring), "ERROR: %i is not a valid car id!", carid);
- SendClientMessage(playerid, COLOR_LIGHTPINK, errorstring);
- }
- } else {
- new errorstring[128];
- format(errorstring, sizeof(errorstring), "ERROR: %i is not a valid player!", toid);
- SendClientMessage(playerid, COLOR_LIGHTPINK, errorstring);
- }
- } else {
- SendClientMessage(playerid, -1, "USAGE: /v [playerid] [car] [color1] [color2]");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- }
- return 1;
- }
- CMD:giveskin(playerid, params[])
- {
- if(pInfo[playerid][Admin] > 1){
- new
- skinid,
- rid,
- aname[MAX_PLAYER_NAME],
- rname[MAX_PLAYER_NAME];
- if(!sscanf(params, "ii", rid, skinid)) {
- if(IsPlayerConnected(rid)){
- //set skin
- SetPlayerSkin(rid, skinid);
- pInfo[rid][Skin] = skinid;
- new amessage[128];
- new rmessage[128];
- GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
- GetPlayerName(rid, rname, MAX_PLAYER_NAME);
- format(amessage, sizeof(amessage), "Skin ID (%i) sent to %s", skinid, rname);
- format(rmessage, sizeof(rmessage), "%s has set your skin! (SkinID:%i)", aname, skinid);
- SendClientMessage(playerid, COLOR_LIGHTPINK, amessage);
- SendClientMessage(rid, COLOR_LIGHTPINK, rmessage);
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "ERROR: This player is not connected!");
- }
- } else {
- SendClientMessage(playerid, -1, "USAGE: /giveskin [playerid] [skinid]");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- }
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- if(pInfo[playerid][Admin] > 1){
- new
- rid,
- money;
- if(!sscanf(params, "ii", rid, money)) {
- if(IsPlayerConnected(rid)){
- new
- aname[MAX_PLAYER_NAME],
- rname[MAX_PLAYER_NAME],
- amessage[128],
- rmessage[128];
- GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
- GetPlayerName(rid, rname, MAX_PLAYER_NAME);
- format(amessage, sizeof(amessage), "$%i was given to %s!", money, rname);
- format(rmessage, sizeof(rmessage), "%s just sent you $%i!", aname, money);
- GivePlayerMoney(rid, money);
- pInfo[rid][Money] = pInfo[rid][Money] + money;
- SendClientMessage(playerid, COLOR_LIGHTPINK, amessage);
- SendClientMessage(rid, COLOR_LIGHTPINK, rmessage);
- } else {
- SendClientMessage(playerid, COLOR_LIGHTPINK, "This player is not online!");
- }
- } else {
- SendClientMessage(playerid, -1, "USAGE: /givemoney [playerid] [amount]");
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- }
- return 1;
- }
- /*
- CMD:od(playerid, params[])
- {
- if(IsPlayerAdmin(playerid)){
- new name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(params == "1"){
- } else if (params == "0"){
- }
- } else {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command.");
- return 1;
- }
- return 1;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement