Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <sscanf2>
- native WP_Hash(buffer[],len,const str[]); // Whirlpool native, add it at the top of your script under includes
- //Colors
- #define yellow 0xFFFF00AA
- #define red 0xFF0000AA
- #define green 0x00FF00AA
- #define aqua 0x00FFFFAA
- #define white 0xFFFFFFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_ORANGE 0xFF9900AA
- //Others
- #define MIN_VEHI_ID 400
- #define MAX_VEHI_ID 611
- #define VEHI_DIS 5.0
- //New's
- new AFK[MAX_PLAYERS];
- new StuntBonus[MAX_PLAYERS];
- new God[MAX_PLAYERS];
- new Boost[MAX_PLAYERS];
- new gPlayerStatus[MAX_PLAYERS];
- new aSelNames[1][] = { // Menu selection names
- {"VehicleSelect"}
- };
- new curPlayerVehM[MAX_PLAYERS] = {MIN_VEHI_ID, ...}; // Current Player Vehicle ID
- new curPlayerVehI[MAX_PLAYERS] = {-1, ...};
- new Float: savedPos[MAX_PLAYERS][4];
- new StuntBonusAll;
- //Register/Login System
- #define dregister 2011 //Defining register dialog so it won't mixed up with the other dialogs
- #define dlogin 2012 //Defining login dialog so it won't mixed up with the other dialogs
- #define UserPath "Xian/%s.ini" /*Will define user's account path. In this case, we will save it in Scriptfiles/Users. So create a file inside of your Scriptfiles folder called Users*/
- //Vehicle name
- 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"
- };
- //Random Message
- new RandomMSG[][] =
- {
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Press 2 to fix your vehicle!",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Use /v to spawn a car.",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Use /godmode if you don't want to die",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Need boost in car? Use /boost now!",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Always read /rules, obey to the /rules.",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Check out our /cmds, /teles and /help!",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Do not ask for admin in chat. This will just reduce your chance.",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Server Scripted by Xian.",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Do you know the script contained about 1200 lines?",
- "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Add our server into favorite list! ultra-h.com:5096"
- };
- #if defined FILTERSCRIPT
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Stunt Project V2 by Xian ");
- print("----------------------------------\n");
- }
- #endif
- enum PlayerInfo
- {
- Pass[129], //User's password
- IP[16], //User's IP
- Money, //User's money
- Scores, //User's scores
- Hours, //User's hours
- Kills, //User's kills
- Deaths //User's deaths
- }
- new pInfo[MAX_PLAYERS][PlayerInfo]; /*This will create a new variable so we can later use it to saving/loading user's info.*/
- enum CURVEHICLE {
- bool:spawn,
- vmodel,
- vInt
- };
- new curServerVehP[MAX_VEHICLES][CURVEHICLE];
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Stunt/Freeroam/DM");
- UsePlayerPedAnims();
- EnableStuntBonusForAll(0);
- SetTimer("SendMSG", 300000, true);
- SetTimer("OneHourBonus", 1000*60*60, 1);
- AddPlayerClass(0, 154.3236,-1946.2644,5.1681,1.0536, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- print("----------------------------------");
- print("--Stunt Project V2 has unloaded!--");
- print("----------------------------------");
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 153.9554,-1912.3206,3.7696);
- SetPlayerFacingAngle(playerid,179.8246);
- SetPlayerCameraPos(playerid, 154.3204,-1942.7327,5.0);
- SetPlayerCameraLookAt(playerid,154.1146,-1938.4088,5.0);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new name[MAX_PLAYER_NAME], string[128], string2[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string), "%s (ID: %d) has joined Stunt Project V2.", name, playerid);
- SendClientMessageToAll(-1, string);
- format(string2,sizeof(string2), "[JOIN]: %s (ID: %d) has joined Stunt Project V2.", name, playerid);
- print(string2);
- SendClientMessage(playerid, white, "{ffff00}StuntProjectV2: {ffffff}(ID: 21) Welcome to Stunt Project V2, read /cmds for more helps!");
- GetPlayerName(playerid,name,sizeof(name)); //Get player's name
- if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
- {// then
- INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
- ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
- }
- else //If the connected user is not registered,
- {//then we will 'force' him to register :)
- ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_PASSWORD,"Register","Welcome! This account is not in our database.\nEnter your own password to create a new account.","Register","Quit");
- return 1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new name[MAX_PLAYER_NAME], string[128], string2[128];
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string), "%s (ID: %d) has left Stunt Project V2.", name, playerid);
- SendClientMessageToAll(-1, string);
- format(string2,sizeof(string2), "[JOIN]: %s (ID: %d) has left Stunt Project V2.", name, playerid);
- print(string2);
- new INI:file = INI_Open(Path(playerid)); //will open their file;
- INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
- INI_WriteInt(file,"Money",GetPlayerMoney(playerid));//We will save his money inside of his account
- INI_WriteInt(file,"Scores",GetPlayerScore(playerid));//We will save his score inside of his account
- INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);//As explained above
- INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);//As explained above
- INI_WriteInt(file,"Hours",pInfo[playerid][Hours]);
- INI_Close(file);//Now after we've done saving their data, we now need to close the file
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid,1956.8210,1343.0056,15.3746);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- pInfo[playerid][Deaths]++;
- if(killerid != INVALID_PLAYER_ID)
- {
- pInfo[killerid][Kills]++;
- }
- SendDeathMessage(killerid, playerid, GetPlayerWeapon(killerid));
- SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
- GameTextForPlayer(playerid, "~r~Wasted!", 3000, 0);
- if ( killerid != INVALID_PLAYER_ID ) // Killer exists.
- {
- new szStr[ 128 ];
- new szName[ 2 ][ MAX_PLAYER_NAME ];
- GetPlayerName( playerid, szName[ 0 ], MAX_PLAYER_NAME );
- GetPlayerName( killerid, szName[ 1 ], MAX_PLAYER_NAME );
- format( szStr, sizeof szStr, "You have been killed by %s.", szName[ 1 ] );
- SendClientMessage( playerid, -1, szStr );
- format( szStr, sizeof szStr, "You have killed %s.", szName[ 0 ] );
- SendClientMessage( playerid, -1, szStr );
- }
- else // No killer exists.
- {
- SendClientMessage( playerid, -1, "You have died without being killed." );
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new name[MAX_PLAYER_NAME], msg[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(msg, sizeof(msg), "(ID: %d) {ffffff}%s", playerid, text);
- SendPlayerMessageToAll(playerid, msg);
- return 0;
- }
- CMD:weapons(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "{ff0000}Weapons {ffffff}Selection", "{ff0000}Melee\n{ffff00}Pistol\nShotguns\n{00ffff}Machine Guns\n{00ff00}Assault Rifles\n{f0f0f0}Snipers\n{ff00ff}Explosive\n{fff000}Special\n{f0f0f0}Sex Toys\n{000fff}Heavy Weapons", "Choose", "Exit");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:melee(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 889, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection: {00ffff}Melee","Golf Club\nNightstick\nKnife\nBaseball Bat\nShovel\nPool Cue\nKatana\nChainsaw","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:pistols(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 890, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection: {00ffff}Pistols","Colt-45\nSlienced Pistol\nDesert Eagle","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:shotguns(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 891, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Shotguns","Shotgun\nSawn-off Shotgun\nCombat Shotgun","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:machineguns(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 892, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Machine Guns","Micro-SMG(Uzi)\nSMG\nTec-9","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:assaultrifles(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 893, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Assault Rifles","AK-47\nM4","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:snipers(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 894, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Snipers","Country Rifle\nSniper Rifle","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:explosive(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 895, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Explosive","Grenade\nTear Gas\nMolotov Cocktail","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:special(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 896, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Specials","Flower\nCane\nSpray Can\nFire Extinguisher\nCamera\nParachute","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:sextoys(playerid,param[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 897, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Sex Toys","Double-ended Dildo\nDildo\nVibrator\nSliver Vibrator","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:heavyweapon(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 898, DIALOG_STYLE_LIST,"{ff0000}Weapons {ffffff}Selection {00ffff}Heavy Weapon","Rocket Launcher\nHeat Seekers\nFlamethrower\nMinigun\nSatchel Charger","Choose","Back");
- }
- else SendClientMessage(playerid, red, "Turn off your godmode first!");
- return 1;
- }
- CMD:afk(playerid,params[])
- {
- if(AFK [playerid] == 0)
- {
- new name[MAX_PLAYER_NAME], string[100];
- AFK[playerid] = 1;
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, yellow, "Type '/afk' to remove AFK status.");
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),"[/AFK]: Player %s is AFK!", name);
- SendClientMessage(playerid, yellow, string);
- }
- else if(AFK [playerid] == 1)
- {
- new name[MAX_PLAYER_NAME], string[100];
- AFK[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid, yellow, "Type '/afk' to AFK again.");
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),"[/AFK]: Player %s is back!", name);
- SendClientMessage(playerid, yellow, string);
- }
- return 1;
- }
- CMD:stuntbonus(playerid,params[])
- {
- if(StuntBonus[playerid] == 0)
- {
- StuntBonus[playerid] = 1;
- EnableStuntBonusForPlayer(playerid, 1);
- SendClientMessage(playerid, yellow, "Stunt bonus has been {ffffff}enabled{ffff00}.");
- }
- else if(StuntBonus[playerid] == 1)
- {
- StuntBonus[playerid] = 0;
- EnableStuntBonusForPlayer(playerid, 0);
- SendClientMessage(playerid, red, "Stunt bonus has been {ffffff}disabled{ff0000}.");
- }
- return 1;
- }
- CMD:godmode(playerid,params[])
- {
- if(God[playerid] == 0)
- {
- God[playerid] = 1;
- SetPlayerHealth(playerid, 100000.0);
- ResetPlayerWeapons(playerid);
- SendClientMessage(playerid, white, "Godmode has been {00ffff}enabled{ffffff}!");
- }
- else if(God[playerid] == 1)
- {
- God[playerid] = 0;
- SetPlayerHealth(playerid, 100.0);
- SendClientMessage(playerid, white, "Godmode has been {00ffff}disabled{ffffff}!");
- }
- return 1;
- }
- CMD:boost(playerid,params[])
- {
- if(Boost[playerid] == 0)
- {
- Boost[playerid] = 1;
- SendClientMessage(playerid, aqua, "Speedboost and bounce has activated!");
- SendClientMessage(playerid, -1, "Press LMB for speedboost and H/CAPS LOCK for bounce.");
- }
- else if(Boost[playerid] == 1)
- {
- Boost[playerid] = 0;
- SendClientMessage(playerid, red, "Speedboost and bounce has deactivated!");
- }
- return 1;
- }
- CMD:v(playerid,params[])
- {
- new
- idx,
- iString[ 128 ];
- if ( gPlayerStatus[ playerid ] != 0 )
- {
- format ( iString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[ gPlayerStatus[ playerid ] - 1 ] );
- SendClientMessage ( playerid, COLOR_RED, iString );
- return true;
- }
- if ( params[ 0 ] == '\0' ) // Same effect as a !strlen check.
- return SendClientMessage( playerid, COLOR_RED, "[USAGE]: /v MODELID/NAME or /vehicle MODELID/NAME" );
- //***************
- // Fix by Mike! *
- //***************
- idx = GetVehicleModelIDFromName( params );
- if( idx == -1 )
- {
- idx = strval(iString);
- if ( idx < MIN_VEHI_ID || idx > MAX_VEHI_ID )
- return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid MODELID/NAME");
- }
- new
- Float:x,
- Float:y,
- Float:z,
- Float:a;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
- GetPlayerFacingAngle(playerid, a);
- curPlayerVehM[playerid] = idx;
- curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
- LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
- curServerVehP[curPlayerVehI[playerid]][spawn] = true;
- curServerVehP[curPlayerVehI[playerid]][vmodel] = idx;
- curServerVehP[curPlayerVehI[playerid]][vInt] = GetPlayerInterior(playerid);
- format(iString, 128, "[SUCCESS]: Spawned a \"%s\" (MODELID: %d, VEHICLEID: %d)", VehicleNames[idx - MIN_VEHI_ID], idx, curPlayerVehI[playerid]);
- SendClientMessage(playerid, COLOR_GREEN, iString);
- return true;
- }
- CMD:myscore(playerid,params[])
- {
- new string[56];
- format(string,sizeof(string), "[INFO]: Your score: %i", GetPlayerScore(playerid));
- SendClientMessage(playerid, yellow, string);
- return 1;
- }
- CMD:pm(playerid, params[]) // We will create a new command ( /pm )
- { // Opening bracket
- new // creating new variables
- iTarget, // a variable called iTarget
- szMsg[ 100 ]; // a variable called szMsg. This will be a string that can carry 100 characters
- if (sscanf( params, "rs[100]", iTarget, szMsg))
- { // If the player hasn't entered the player or the message ( r = playerID / name || s = string )
- return SendClientMessage(playerid, 0xFF3333AA, "[USAGE]: /pm (id/name) (message)");
- // Sends the player message about the correct command usage.
- }
- if (iTarget == INVALID_PLAYER_ID) // The player is not connected!
- {
- return SendClientMessage(playerid, red, "[ERROR]: The player is not connected!");
- // Sends the player message that he/she has entered a wrong ID.
- }
- new
- szStr[128]; // Now, we will create another variable called " szStr ".
- // 128 is the max size for client mesages.
- new
- pName[MAX_PLAYER_NAME], // We will create another variable which will store the sender's name
- tName[MAX_PLAYER_NAME]; // Same as above, except this is to store the target's name
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- // We will get the sender's name and store it at the pName variable
- GetPlayerName(iTarget, tName, MAX_PLAYER_NAME);
- // We will get the target's name and store it at the tName variable
- // We will format the message.
- format(szStr, sizeof (szStr), "[PM from %s]: %s", pName, szMsg );
- // %s is used to format strings, the first %s is the player's name ( pName ),
- // and the second %s is the message. ( szMsg )
- SendClientMessage(iTarget, 0x33FF33AA, szStr);
- // Sends the target the PM which the sender has sent.
- // We will format another message.
- format(szStr, sizeof(szStr), "[PM to %s]: %s", tName, szMsg);
- // %s is used to format strings, the first %s is the target's name ( tName ),
- // and the second %s is the message. ( szMsg )
- SendClientMessage(playerid, 0x33FF33AA, szStr);
- // Sends the sender message about the message he has sent.
- return true;
- } // Closing bracket
- CMD:stats(playerid,params[])
- {
- new string[256], name[MAX_PLAYER_NAME], ip[16];
- GetPlayerName(playerid, name, sizeof(name));
- new score = GetPlayerScore(playerid);
- new cash = GetPlayerMoney(playerid);
- new kills = pInfo[playerid][Kills]; //This line
- new deaths = pInfo[playerid][Deaths]; //This line
- GetPlayerIp(playerid, ip, 16);
- new hours = pInfo[playerid][Hours];
- format(string,sizeof(string), "Name: %s\nYour IP: %s\nCurrent ID: %d\nScore: %i\nCash: $%d\nKills: %d\nDeaths: %d\nHours Online: %d", name, ip, playerid, score, cash, kills, deaths, hours);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Your stats", string, "OK", "");
- return 1;
- }
- CMD:cmds(playerid,params[])
- {
- new string[512],longstring[1024];
- format(string,sizeof(string), "/sp, /lp - Save/Load position\n/v, /car - Spawn a car\n/myscore - Checks your score\n/godmode - Toggle Godmode\n/stuntbonus - Toggle stunt bonus\n/pm - Send Private Message\n/stats - Your stats\n/afk - AFK/BACK status\n/weapons - Free weapons\n/myscore - Checks your score", "OK","");
- strcat(longstring,string,sizeof(longstring));
- format(string,sizeof(string), "\n/boost - Toggle Speedboost\n/goto - Goto another player\n/myip - Check your IP\n/kill - Suicide");
- strcat(longstring,string,sizeof(longstring));
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "{ffff00}Server {00ffff}Commands", longstring, "OK", "");
- return 1;
- }
- CMD:sp(playerid, params[]) {
- GetPlayerPos(playerid, savedPos[playerid][0], savedPos[playerid][1], savedPos[playerid][2]);
- if (IsPlayerInAnyVehicle(playerid)) {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), savedPos[playerid][3]);
- }
- else {
- GetPlayerFacingAngle(playerid, savedPos[playerid][3]);
- }
- GameTextForPlayer(playerid, "~g~Position saved!~n~~w~/lp to load it.", 2000, 3);
- return true;
- }
- CMD:lp(playerid, params[]) {
- switch (GetPlayerState(playerid)) {
- case PLAYER_STATE_DRIVER: {
- SetVehiclePos(GetPlayerVehicleID(playerid), savedPos[playerid][0], savedPos[playerid][1], savedPos[playerid][2]);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), savedPos[playerid][3]);
- }
- default: {
- SetPlayerPos(playerid, savedPos[playerid][0], savedPos[playerid][1], savedPos[playerid][2]);
- SetPlayerFacingAngle(playerid, savedPos[playerid][3]);
- }
- }
- GameTextForPlayer(playerid, "~g~Position loaded!", 2000, 3);
- return 1;
- }
- CMD:me(playerid, params[]) {
- if (isnull(params)) return SendClientMessage(playerid, COLOR_ORANGE, "~/me <action>");
- new name[MAX_PLAYER_NAME], str[128];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- format(str, 128, "* %s %s", name, params);
- SendClientMessageToAll(-1, str);
- return true;
- }
- CMD:goto(playerid, params[])
- {
- new ID;
- new pn[MAX_PLAYER_NAME];
- new an[MAX_PLAYER_NAME];
- new str[128];
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]"); //This is a long line, "sscanf" is the plugin that search the missing params, "params" is the param that define params LOL, "u" is the PARAM that define the MISSING ID, ID is the param for the targetid
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is not connected");//Same as !IsPlayerAdmin, but instead of "playerid" we put "ID" because it's the targetid
- GetPlayerName(playerid, an, MAX_PLAYER_NAME);//Define the playerid's param
- GetPlayerName(ID, pn, MAX_PLAYER_NAME);//Define the ID's param
- new Float:x; //Defining float X
- new Float:y; //Same
- new Float:z; //Same
- GetPlayerPos(ID, x, y, z); //This line get the "ID" position
- SetPlayerPos(playerid, x+1, y+1, z); //This line set the "playerid" position from "ID" position, with some changes(x+1, y+1);
- format(str, sizeof(str), "You have been teleported to %s.", pn); //Showed before, this is the line that give the message to playerid)
- SendClientMessage(playerid, 0x00FF00AA, str); //This line give the message to playerid
- if(IsPlayerInAnyVehicle(playerid)) //Mhh, let's give you a question, what should this callback do?
- {
- GetPlayerPos(ID, x, y, z);
- SetVehiclePos(playerid, x+1, y+1, z); //And this one? :D
- }
- return 1;
- }
- CMD:myip(playerid,params[])
- {
- new ip[16], string[56];
- GetPlayerIp(playerid, ip, 16);
- format(string,sizeof(string), "Your IP: %s", ip);
- SendClientMessage(playerid, yellow, string);
- return 1;
- }
- CMD:kill(playerid,params[])
- {
- new name[25],string[100];
- SetPlayerHealth(playerid, 0);
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string), "%s has suicided!", name);
- SendClientMessage(playerid, aqua, string);
- return 1;
- }
- CMD:stuntbonusforall(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if(StuntBonusAll == 0)
- {
- new name[25],string[100];
- StuntBonusAll = 1;
- EnableStuntBonusForAll(1);
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string), "RCON Admin %s has enabled Stunt Bonus For All!", name);
- SendClientMessageToAll(white, string);
- }
- else if(StuntBonusAll == 1)
- {
- new name[25],string[100];
- StuntBonusAll = 0;
- EnableStuntBonusForAll(0);
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string), "RCON Admin %s has disabled Stunt Bonus For All!", name);
- SendClientMessageToAll(white, string);
- }
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, red, "[ERROR]: You must be a RCON admin to do this!");
- }
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new string[128],string2[128], name[56];
- format(string, sizeof(string), "[INFO]: You've entered %s.", GetVehicleName(vehicleid));
- SendClientMessage(playerid, -1, string);
- format(string2, sizeof(string2), "[INFO]: %s exited %s.", name, GetVehicleName(vehicleid));
- print(string2);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- new string[128], string2[128], name[56];
- format(string, sizeof(string), "[INFO]: You've exited %s.", GetVehicleName(vehicleid));
- SendClientMessage(playerid, -1, string);
- GetPlayerName(playerid, name, sizeof(name));
- format(string2, sizeof(string2), "[INFO]: %s exited %s.", name, GetVehicleName(vehicleid));
- print(string2);
- 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)
- {
- if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(newkeys & KEY_FIRE)
- {
- if(Boost[playerid] == 1)
- {
- new Float:vx,Float:vy,Float:vz;
- GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
- SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
- }
- }
- }
- if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if (newkeys & KEY_CROUCH)
- {
- if(Boost[playerid] == 1)
- {
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
- SetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z+0.3);
- }
- }
- }
- if(newkeys & KEY_SUBMISSION) //If they press 2
- {
- if(GetPlayerState(playerid) == 2) //If they are driving a vehicle
- {
- SetVehicleHealth(GetPlayerVehicleID(playerid),1000); //Set player's vehicle health to 1000
- RepairVehicle(GetPlayerVehicleID(playerid)); //Repair their vehicle(doors,hood, etc)
- }
- }
- if(newkeys & KEY_FIRE)
- {
- if(GetPlayerState(playerid) == 2)
- {
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- }
- }
- 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[])
- {
- if(dialogid == dregister) //If dialog id is a register dialog
- {//then
- if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
- if(response) //if they clicked the first button "Register"
- {//then
- if(!strlen(inputtext)) //If they didn't enter any password
- {// then we will tell to them to enter the password to register
- ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_PASSWORD,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
- return 1;
- }
- //If they have entered a correct password for his/her account...
- new hashpass[129]; //Now we will create a new variable to hash his/her password
- WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
- new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
- INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
- INI_WriteString(file,"Password",hashpass);//This will write a hashed password into user's account
- INI_WriteInt(file,"Money",5000);//Write an integer inside of user's account called "Money". We will set their money to 0 after he registered
- INI_WriteInt(file,"Scores",0);//Write an integer inside of user's account called "Scores". We will set their score to 0 after he registered
- INI_WriteInt(file,"Kills",0);//As explained above
- INI_WriteInt(file,"Deaths",0);//As explained above
- INI_WriteInt(file,"Hours",0);
- INI_Close(file);//Now after we've done saving their data, we now need to close the file
- SendClientMessage(playerid,-1,"You have been successfully registered"); //Tell to them that they have successfully registered a new account
- SendClientMessage(playerid, -1, "The system has given you $5000 as a reward for registering!");
- GivePlayerMoney(playerid, 5000);
- return 1;
- }
- }
- if(dialogid == dlogin) //If dialog id is a login dialog
- {//then
- if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
- if(response) //if they clicked the first button "Register"
- {//then
- new hashpass[129]; //Will create a new variable to hash his/her password
- WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
- if(!strcmp(hashpass,pInfo[playerid][Pass])) //If they have insert their correct password
- {//then
- new string[128], name[25];
- INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path
- SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here
- GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),"Welcome back! You have successfully logged in as %s", name);
- SendClientMessage(playerid,-1,string);//Tell them that they've successfully logged in
- }
- else //If they've entered an incorrect password
- {//then
- ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"Login","Welcome back. Incorrect password! Try again!","Login","Quit");//We will tell to them that they've entered an incorrect password
- return 1;
- }
- }
- }
- switch(dialogid)
- {
- case 888:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return cmd_melee(playerid,"params");
- case 1:return cmd_pistols(playerid,"params");
- case 2:return cmd_shotguns(playerid,"params");
- case 3:return cmd_machineguns(playerid,"params");
- case 4:return cmd_assaultrifles(playerid,"params");
- case 5:return cmd_snipers(playerid,"params");
- case 6:return cmd_explosive(playerid,"params");
- case 7:return cmd_special(playerid,"params");
- case 8:return cmd_sextoys(playerid,"params");
- case 9:return cmd_heavyweapon(playerid,"params");
- }
- }
- }
- case 889:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 2, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Golf Club.");
- case 1:return GivePlayerWeapon(playerid, 3, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Nightstick.");
- case 2:return GivePlayerWeapon(playerid, 4, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Knife.");
- case 3:return GivePlayerWeapon(playerid, 5, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Baseball Bat.");
- case 4:return GivePlayerWeapon(playerid, 6, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Shovel.");
- case 5:return GivePlayerWeapon(playerid, 7, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Pool Cue.");
- case 6:return GivePlayerWeapon(playerid, 8, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Katana.");
- case 7:return GivePlayerWeapon(playerid, 9, 1) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Chainsaw.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 890:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 22, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Colt 45.");
- case 1:return GivePlayerWeapon(playerid, 23, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Slienced Colt 45.");
- case 2:return GivePlayerWeapon(playerid, 24, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Desert Eagle.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 891:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 25, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Shotgun.");
- case 1:return GivePlayerWeapon(playerid, 26, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Sawnoff Shotgun.");
- case 2:return GivePlayerWeapon(playerid, 27, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Combat Shotgun.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 892:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 28, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Micro Uzi.");
- case 1:return GivePlayerWeapon(playerid, 29, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a SMG.");
- case 2:return GivePlayerWeapon(playerid, 32, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Tec-9.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 893:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 30, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got an AK-47.");
- case 1:return GivePlayerWeapon(playerid, 31, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a M4.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 894:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:return GivePlayerWeapon(playerid, 33, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a country rifle.");
- case 1:return GivePlayerWeapon(playerid, 34, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Sniper rifle.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 895:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:GivePlayerWeapon(playerid, 16, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Grenade.");
- case 1:GivePlayerWeapon(playerid, 17, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Tear Gas.");
- case 2:GivePlayerWeapon(playerid, 18, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Molotov.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 896:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:GivePlayerWeapon(playerid, 14, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Flower.");
- case 1:GivePlayerWeapon(playerid, 15, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Cane.");
- case 2:GivePlayerWeapon(playerid, 41, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Spray Can.");
- case 3:GivePlayerWeapon(playerid, 42, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Fire Extinguisher.");
- case 4:GivePlayerWeapon(playerid, 43, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Camera.");
- case 5:GivePlayerWeapon(playerid, 46, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a Parachute.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 897:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:GivePlayerWeapon(playerid, 10, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a double-ended dildo.");
- case 1:GivePlayerWeapon(playerid, 11, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a dildo.");
- case 2:GivePlayerWeapon(playerid, 12, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a vibrator.");
- case 3:GivePlayerWeapon(playerid, 13, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a sliver vibrator.");
- }
- }
- else return cmd_weapons(playerid,"params");
- }
- case 898:
- {
- if(response)
- {
- if(IsPlayerAdmin(playerid))
- {
- switch(listitem)
- {
- case 0:GivePlayerWeapon(playerid, 35, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a rocket launcher.");
- case 1:GivePlayerWeapon(playerid, 36, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a heat seeker launcher.");
- case 2:GivePlayerWeapon(playerid, 37, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a flamethrower.");
- case 3:GivePlayerWeapon(playerid, 38, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a minigun.");
- case 4:GivePlayerWeapon(playerid, 39, 9999) && SendClientMessage(playerid, 0xFF9900AA, "[INFO]: You've got a satchel charge.");
- }
- }
- }
- else return cmd_weapons(playerid,"params") && SendClientMessage(playerid, 0xFF000000, "[ERROR]: You are not a RCON admin");
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock GetVehicleName(vehicleid)
- {
- new string[128];
- format(string,sizeof(string),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
- return string;
- }
- stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
- {
- new str[128],name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(str,sizeof(str),UserPath,name);
- return str;
- }
- stock GetVehicleModelIDFromName(vname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if ( strfind(VehicleNames[i], vname, true) != -1 )
- return i + MIN_VEHI_ID;
- }
- return -1;
- }
- stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- { // Created by Y_Less
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid)) {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- forward loadaccount_user(playerid, name[], value[]); //forwarding a new function to load user's data
- public loadaccount_user(playerid, name[], value[])
- {
- INI_String("Password", pInfo[playerid][Pass],129); /*we will use INI_String to load user's password.
- ("Password",.. will load user's password inside of user's path. 'pInfo[playerid][Pass]',...We have defined our user's variable above called, pInfo. Now it's time to use it here to load user's password. '129',... 129 is a length of a hashed user's password. Whirlpool will hash 128 characters + NULL*/
- INI_String("IP", pInfo[playerid][IP],16);
- INI_Int("Money",pInfo[playerid][Money]); //As explained above
- INI_Int("Scores",pInfo[playerid][Scores]);//As explained above
- INI_Int("Kills",pInfo[playerid][Kills]);//As explained above
- INI_Int("Deaths",pInfo[playerid][Deaths]);//As explained above
- INI_Int("Hours",pInfo[playerid][Hours]);
- return 1;
- }
- forward SendMSG();
- public SendMSG()
- {
- new randMSG = random(sizeof(RandomMSG));
- SendClientMessageToAll(0xFFFFAAAA, RandomMSG[randMSG]);
- }
- stock GetPlayerKills(playerid, name[], value[])
- {
- INI_Int("Kills",pInfo[playerid][Kills]);
- return 1;
- }
- stock GetPlayerDeaths(playerid,name[], value[])
- {
- INI_Int("Deaths",pInfo[playerid][Deaths]);
- return 1;
- }
- forward OneHourBonus();
- public OneHourBonus()
- {
- for (new i, slots = GetMaxPlayers(); i < slots; i ++)
- {
- GivePlayerMoney(i, 5000);
- SetPlayerScore(i,GetPlayerScore(i)+5);
- SendClientMessage(i, -1, "Thanks for playing on our server for 1 hour! As a bonus, $5000 and 5 scores have been given you.");
- pInfo[i][Hours]++;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment