Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // This is a Team Deadmath gamemode.
- /*
- Credits:
- Login & Register System - Kushi
- Gamemode - By me!
- !!!! DO NOT REMOVE CREDITS plz !!!!
- */
- #include <a_samp>
- #include <YSI\y_ini>
- #include <sscanf>
- #include <zcmd>
- #include <a_samp>
- #include <core>
- #include <float>
- #pragma tabsize 0
- // Dialogs:
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_GUNSHOP 3
- //Folder:
- #define FOLDER "Server Stats/Players/%s.ini"
- //Colors:
- #define COLOR_RED 0xF21616FF
- #define COLOR_GREY 0xDBDBDBFF
- #define COLOR_YELLOW 0xF7EA31FF
- #define COLOR_GREEN 0x509E2CFF
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define COLOR_BLUE 0x42E5EDFF
- #define RUSSIAN 1
- #define ENGLISH 2
- //Enums:
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- Score
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new Text:tdm;
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Score",PlayerInfo[playerid][Score]);
- return 1;
- }
- // Forwards:
- forward LoadUser_data(playerid,name[],value[]);
- main()
- {
- print("\nTDM v0.1 Loaded...!");
- print("Gamemode owner: finelaq");
- print("Gamemode version: 0.1\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("TDM v0.1");
- ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
- ShowNameTags(1);
- SetNameTagDrawDistance(40.0);
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- tdm = TextDrawCreate(340, 430, "Team Deadmatch");
- TextDrawLetterSize(Text:tdm, 1, 1);
- TextDrawColor(Text:tdm, -1439485014);
- TextDrawUseBox(Text:tdm, 1);
- TextDrawBoxColor(Text:tdm, -1347440726);
- TextDrawBackgroundColor(Text:tdm, -1347440726);
- TextDrawFont(Text:tdm, 1);
- AddPlayerClass(124, -632.3953,-1827.8872,26.1501,263.8289, 16, 5000, 24, 5000, 30, 5000);
- AddPlayerClass(125, -632.3953,-1827.8872,26.1501,263.8289, 16, 5000, 24, 5000, 30, 5000);
- AddPlayerClass(126, -632.3953,-1827.8872,26.1501,263.8289, 16, 5000, 24, 5000, 30, 5000);
- AddPlayerClass(127, -632.3953,-1827.8872,26.1501,263.8289, 16, 5000, 24, 5000, 30, 5000);
- AddPlayerClass(287,-806.8970,-2146.7820,23.6459,259.6623,16, 5000, 24, 5000, 31, 5000);
- AddPlayerClass(289,-806.8970,-2146.7820,23.6459,259.6623,16, 5000, 24, 5000, 31, 5000);
- AddPlayerClass(290,-806.8970,-2146.7820,23.6459,259.6623,16, 5000, 24, 5000, 31, 5000);
- AddPlayerClass(291,-806.8970,-2146.7820,23.6459,259.6623,16, 5000, 24, 5000, 31, 5000);
- // Russians Cars
- CreateVehicle(433,-666.9839,-1838.2065,20.9851,19.8234,43,0,50); // RUSsian Car
- CreateVehicle(433,-662.4078,-1837.7744,21.7216,16.1306,43,0,50); // RUSsian Car 2
- CreateVehicle(433,-658.4218,-1836.1825,22.6968,32.7560,43,0,50); // RUSsian Car 3
- CreateVehicle(432,-635.4351,-1840.2036,23.3916,319.8014,43,0,50); // RUSsian Tank 1
- // English Cars
- CreateVehicle(432,-820.8715,-2195.9976,24.3344,22.4344,43,0,50); // english tnak
- CreateVehicle(433,-837.4163,-2182.2271,24.5591,3.1204,43,0,50); // english car 1
- CreateVehicle(433,-844.7979,-2180.7366,25.4523,30.3800,43,0,50); // english ccar 2
- CreateVehicle(433,-852.4243,-2180.5713,26.0133,24.1338,43,0,50); // english ccar 3
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- switch ( classid )
- {
- case 0:
- {
- GameTextForPlayer( playerid, "~r~TEAM RUSSIANS", 300, 3 );
- SetPlayerColor(playerid, COLOR_RED);
- SetPlayerTeam(playerid, RUSSIAN);
- }
- case 1:
- {
- GameTextForPlayer( playerid, "~r~TEAM RUSSIANS", 300, 3 );
- SetPlayerColor(playerid, COLOR_RED);
- SetPlayerTeam(playerid, RUSSIAN);
- }
- case 2:
- {
- GameTextForPlayer( playerid, "~r~TEAM RUSSIANS", 300, 3 );
- SetPlayerColor(playerid, COLOR_RED);
- SetPlayerTeam(playerid, RUSSIAN);
- }
- case 3:
- {
- GameTextForPlayer( playerid, "~r~TEAM RUSSIANS", 300, 3 );
- SetPlayerColor(playerid, COLOR_RED);
- SetPlayerTeam(playerid, RUSSIAN);
- }
- case 4:
- {
- GameTextForPlayer( playerid, "~b~TEAM ENGLISH", 300, 3 );
- SetPlayerColor(playerid, COLOR_BLUE);
- SetPlayerTeam(playerid, ENGLISH);
- }
- case 5:
- {
- GameTextForPlayer( playerid, "~b~TEAM ENGLISH", 300, 3 );
- SetPlayerColor(playerid, COLOR_BLUE);
- SetPlayerTeam(playerid, ENGLISH);
- }
- case 6:
- {
- GameTextForPlayer( playerid, "~b~TEAM ENGLISH", 300, 3 );
- SetPlayerColor(playerid, COLOR_BLUE);
- SetPlayerTeam(playerid, ENGLISH);
- }
- case 7:
- {
- GameTextForPlayer( playerid, "~b~TEAM ENGLISH", 300, 3 );
- SetPlayerColor(playerid, COLOR_BLUE);
- SetPlayerTeam(playerid, ENGLISH);
- }
- }
- SetPlayerPos(playerid, -672.4181,-2021.0236,24.0982);
- SetPlayerFacingAngle(playerid,92.4747);
- SetPlayerCameraPos(playerid, -681.2284,-2023.6765,23.5072);
- SetPlayerCameraLookAt(playerid, -681.2284,-2023.6765,23.5072);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"%s has connected server!",pName);
- SendClientMessageToAll(0xFFFFFFAA,string);
- TextDrawShowForPlayer(playerid,tdm);
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"SERVER NAME",""COL_WHITE"Welcome back to TDM!,\n\nPlease type your account password:","Log-In","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"SERVER NAME",""COL_WHITE"Welcome to TDM!,\n\nPlease type your account password, to register:","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Score",GetPlayerScore(playerid));
- INI_Close(File);
- TextDrawHideForPlayer(playerid,tdm);
- new szString[64],name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- switch(reason)
- {
- case 0: format(szString, sizeof szString, "%s has left the server. (Crashed)", name);
- case 1: format(szString, sizeof szString, "%s has left the server. (Left)", name);
- case 2: format(szString, sizeof szString, "%s has left the server. (Kicked)", name);
- }
- SendClientMessageToAll(0xC4C4C4FF, szString);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(GetPlayerTeam(playerid) == RUSSIAN)
- {
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"%s has joined the team: RUSSIAN!",pName);
- SendClientMessageToAll(COLOR_RED,string);
- }
- if(GetPlayerTeam(playerid) == ENGLISH)
- {
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"%s has joined the team: ENGLISH!",pName);
- SendClientMessageToAll(COLOR_BLUE,string);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new cash;
- new PlayerScore = GetPlayerScore(playerid);
- if(killerid == INVALID_PLAYER_ID) {
- ResetPlayerMoney(playerid);
- } else {
- cash = GetPlayerMoney(playerid);
- if(cash > 0) {
- GivePlayerMoney(killerid, cash);
- ResetPlayerMoney(playerid);
- }
- }
- if ( killerid != INVALID_PLAYER_ID )
- {
- if ( GetPlayerTeam( killerid ) == GetPlayerTeam( playerid ) )
- {
- SetPlayerHealth( killerid, -1 );
- SendClientMessage( killerid, -1, "No teamkilling." );
- GivePlayerMoney( killerid, - 150000 );
- }
- else
- {
- SendClientMessage( killerid, -1, "Nice shot!" );
- SetPlayerScore(playerid,PlayerScore);
- }
- }
- SendDeathMessage( killerid, playerid, reason );
- PlayerInfo[playerid][pDeaths]++;
- PlayerInfo[killerid][pKills]++;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(text[0] == ':')
- {
- new string[128]; GetPlayerName(playerid, string, sizeof(string));
- format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]);
- printf("%s", string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
- }
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- 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_GUNSHOP:
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) <500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Knife!");
- GivePlayerWeapon(playerid,4,1);
- GivePlayerMoney(playerid,-500);
- }
- if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Baseball bat!");
- GivePlayerWeapon(playerid,5,1);
- GivePlayerMoney(playerid,-1500);
- }
- if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Grenade!");
- GivePlayerWeapon(playerid,16,5000);
- GivePlayerMoney(playerid,-2500);
- }
- if(listitem == 3)
- {
- if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Tear Gas!");
- GivePlayerWeapon(playerid,17,5000);
- GivePlayerMoney(playerid,-2500);
- }
- if(listitem == 4)
- {
- if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Molotov Cocktail!");
- GivePlayerWeapon(playerid,18,5000);
- GivePlayerMoney(playerid,-2500);
- }
- if(listitem == 5)
- {
- if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying 9mm!");
- GivePlayerWeapon(playerid,22,5000);
- GivePlayerMoney(playerid,-3000);
- }
- if(listitem == 6)
- {
- if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Desert Eagle!");
- GivePlayerWeapon(playerid,24,5000);
- GivePlayerMoney(playerid,-5000);
- }
- if(listitem == 7)
- {
- if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Shotgun!");
- GivePlayerWeapon(playerid,25,5000);
- GivePlayerMoney(playerid,-5000);
- }
- if(listitem == 8)
- {
- if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying Combat Shotgun!");
- GivePlayerWeapon(playerid,27,5000);
- GivePlayerMoney(playerid,-5000);
- }
- if(listitem == 9)
- {
- if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying MP5!");
- GivePlayerWeapon(playerid,29,5000);
- GivePlayerMoney(playerid,-2500);
- }
- if(listitem == 10)
- {
- if(GetPlayerMoney(playerid) <1000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying AK-47!");
- GivePlayerWeapon(playerid,30,5000);
- GivePlayerMoney(playerid,-1000);
- }
- if(listitem == 11)
- {
- if(GetPlayerMoney(playerid) <1000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying MP4!");
- GivePlayerWeapon(playerid,31,5000);
- GivePlayerMoney(playerid,-1000);
- }
- if(listitem == 12)
- {
- if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid,COLOR_RED, "You don't have the money!");
- SendClientMessage(playerid,COLOR_RED,"Thank you, for buying RPG!");
- GivePlayerWeapon(playerid,35,7000);
- GivePlayerMoney(playerid,-10000);
- }
- }
- }
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"SERVER NAME",""COL_RED"Heres no password!\n"COL_WHITE"Try aigan! Type password to register account:","Register","Quit"); new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_WriteInt(File,"Score",0);
- INI_Close(File);
- SendClientMessage(playerid,COLOR_GREEN,"You are succesuly registred!");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
- SendClientMessage(playerid,COLOR_GREEN,"You are succesuly logged in!");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"SERVER NAME",""COL_RED"This is incorrect password.\n"COL_WHITE"Try aigan! Type your password:","log-In","Quit");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- COMMAND:gunshop(playerid, params[])
- {
- ShowPlayerDialog(playerid, DIALOG_GUNSHOP, DIALOG_STYLE_LIST,"GUNSHOP 0.1","Gun 1: Knife 500$\nGun 2: Baseball Bat 1,500$\nGun 3: Grenade 2,500$\nGun 4: Tear Gas 2,500$\nGun 5: Molotov Cocktail 2,500$\nGun 6: 9mm 3,000$\nGun 7: Desert Eagle 5,000$\nGun 8: Shotgun 5,000$\nGun 9: Combat Shotgun 5,000$\nGun 10: MP5 2,500$\nGun 11: AK-47 1,000$\nGun 12: MP4 1,000$\nGun 13: RPG 10,000$\n\n\tMore Coming Soon!","Buy","Quit");
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new id, reason[128];
- if(PlayerInfo[playerid][pAdmin] <= 1) return SendClientMessage(playerid, COLOR_GREY, "You don't have the rights!");
- else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_GREY, "USE: /kick [Player ID] [Reason]");
- else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_GREY,"You can't kick bots!");
- else {
- new Name[MAX_PLAYER_NAME], KickMessage[128];
- new Name2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(KickMessage, sizeof(KickMessage), "AdmCmd: Admin %s(%d) has kicked %s(%d) out of the server. Reason: %s", Name, playerid, Name2, id);
- SendClientMessageToAll(COLOR_RED, KickMessage);
- Kick(id);
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- new id, reason[128];
- if(PlayerInfo[playerid][pAdmin] <= 1) return SendClientMessage(playerid, COLOR_GREY, "You don't have the rights!");
- else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_GREY, "USE: /ban [Player ID] [Reason]");
- else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_GREY,"You can't ban bots");
- else {
- new Name[MAX_PLAYER_NAME], KickMessage[128];
- new Name2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(KickMessage, sizeof(KickMessage), "AdmCmd: Admin %s(%d) blocked the %s(%d) account. Reason: %s", Name, playerid, Name2, id);
- SendClientMessageToAll(COLOR_RED, KickMessage);
- Ban(id);
- }
- return 1;
- }
- COMMAND:givecash(playerid, params[])
- {
- new player, amount,name1[24], name2[24], string[128];
- if(!sscanf(params, "ui",player,amount))
- {
- GetPlayerName(playerid, name1, 24);
- GetPlayerName(player, name2, 24);
- format(string, sizeof(string), "You gaved $%d to %s.",amount,name2);
- SendClientMessage(playerid, 0xFFFF00FF, string);
- format(string, sizeof(string), "AdmCmd: Admin %s gave you $%d!", name1, amount);
- SendClientMessage(player, 0xFFFF00FF, string);
- GivePlayerMoney(player, amount);
- }
- else return SendClientMessage(playerid, 0xFFFFFFFF,"Usage: /givecash [Player ID][Amount]");
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),FOLDER,playername);
- return string;
- }
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement