Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <Dini>
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_TEAM 3
- #define DIALOG_CLASS 4
- #define DIALOG_PISTOL 5
- #define MAX_SPAWNED_VEHICLES 6
- #define rot 0xFF0000FF
- #define gelb 0xFFFF00FF
- forward newround();
- forward todeszeit();
- forward cooldown();
- enum info
- {
- logged,
- pw,
- deathtime,
- tot,
- team,
- klasse,
- pistol,
- skin,
- gadget,
- c4,
- c4car,
- Float:x,
- Float:y,
- Float:z,
- Float:za,
- gun,
- sgun,
- lkills,
- ltode,
- kills,
- tode,
- lscore,
- score,
- spree,
- longestspree,
- medickills,
- pionierkills,
- versorgungkills,
- sniperkills,
- m4kills, //medic
- mp5kills, //pionier
- atkills, //pionier (Rakete)
- shotgunkills, //versorgung
- c4kills, //versorgung
- riflekills, //sniper
- admin
- }
- new pInfo[MAX_PLAYERS][info];
- new USKills;
- new RUKills;
- new maxscore;
- new bestplayer[MAX_PLAYER_NAME];
- new bomb[MAX_SPAWNED_VEHICLES];
- new c4model[MAX_SPAWNED_VEHICLES];
- new Text:wontxt;
- new Text:losttxt;
- new Text:ustxt;
- new Text:rutxt;
- new Text:besttxt;
- new Text:playertxt;
- new Text:killer[MAX_PLAYERS];
- new Text:respawn;
- main()
- {
- print("\n----------------------------------");
- print(" BF3 Fighters Gamemode by ATzeGER_ loaded.");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- UsePlayerPedAnims();
- DisableInteriorEnterExits();
- EnableStuntBonusForAll(0);
- ShowPlayerMarkers(0);
- SetGameModeText("Battlefield 3 TDM");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- SetWorldTime(6);
- SetNameTagDrawDistance(25);
- AddStaticVehicleEx(470,1014.4963,1066.9143,10.9955,11.5755,43,0,30); // ushmv1
- AddStaticVehicleEx(470,981.2984,1080.7491,10.8112,311.0829,43,0,30); // ushmv2
- AddStaticVehicleEx(470,1007.6874,1089.0450,10.8114,353.1354,43,0,30); // ushmv3
- AddStaticVehicleEx(470,1876.4500,1179.4844,10.8224,180.7683,43,0,30); // ruhmv
- AddStaticVehicleEx(470,1870.7285,1150.7804,10.8242,270.0080,43,0,30); // ruhmv2
- AddStaticVehicleEx(470,1843.7463,1158.4912,10.8277,270.3376,43,0,30); // ruhmv3
- SetTimer("todeszeit", 1000, true);
- // TD's
- wontxt = TextDrawCreate(234.000000, 119.000000, "your team won!");
- TextDrawBackgroundColor(wontxt, 255);
- TextDrawFont(wontxt, 2);
- TextDrawLetterSize(wontxt, 0.490000, 2.399999);
- TextDrawColor(wontxt, 65535);
- TextDrawSetOutline(wontxt, 1);
- TextDrawSetProportional(wontxt, 1);
- losttxt = TextDrawCreate(234.000000, 119.000000, "your team lost!");
- TextDrawBackgroundColor(losttxt, 255);
- TextDrawFont(losttxt, 2);
- TextDrawLetterSize(losttxt, 0.490000, 2.399999);
- TextDrawColor(losttxt, -16776961);
- TextDrawSetOutline(losttxt, 1);
- TextDrawSetProportional(losttxt, 1);
- ustxt = TextDrawCreate(43.000000, 320.000000, "US MARINES");
- TextDrawBackgroundColor(ustxt, 255);
- TextDrawFont(ustxt, 3);
- TextDrawLetterSize(ustxt, 0.470000, 1.600000);
- TextDrawColor(ustxt, 65535);
- TextDrawSetOutline(ustxt, 1);
- TextDrawSetProportional(ustxt, 1);
- rutxt = TextDrawCreate(55.000000, 320.000000, "RU Army");
- TextDrawBackgroundColor(rutxt, 255);
- TextDrawFont(rutxt, 3);
- TextDrawLetterSize(rutxt, 0.470000, 1.600000);
- TextDrawColor(rutxt, -16776961);
- TextDrawSetOutline(rutxt, 1);
- TextDrawSetProportional(rutxt, 1);
- besttxt = TextDrawCreate(279.000000, 140.000000, "best player:");
- TextDrawBackgroundColor(besttxt, 255);
- TextDrawFont(besttxt, 2);
- TextDrawLetterSize(besttxt, 0.310000, 1.700000);
- TextDrawColor(besttxt, 673775615);
- TextDrawSetOutline(besttxt, 0);
- TextDrawSetProportional(besttxt, 1);
- TextDrawSetShadow(besttxt, 1);
- playertxt = TextDrawCreate(323.000000, 153.000000, "playername");
- TextDrawAlignment(playertxt, 2);
- TextDrawBackgroundColor(playertxt, 255);
- TextDrawFont(playertxt, 2);
- TextDrawLetterSize(playertxt, 0.310000, 1.700000);
- TextDrawColor(playertxt, 673775615);
- TextDrawSetOutline(playertxt, 0);
- TextDrawSetProportional(playertxt, 1);
- TextDrawSetShadow(playertxt, 1);
- respawn = TextDrawCreate(320.000000, 410.000000, "press '~k~~VEHICLE_ENTER_EXIT~' to respawn");
- TextDrawAlignment(respawn, 2);
- TextDrawBackgroundColor(respawn, 255);
- TextDrawFont(respawn, 3);
- TextDrawLetterSize(respawn, 0.450000, 1.800000);
- TextDrawColor(respawn, -65281);
- TextDrawSetOutline(respawn, 1);
- TextDrawSetProportional(respawn, 1);
- //
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerCameraPos(playerid, 1494.4502, 794.5917, 99.0343);
- SetPlayerCameraLookAt(playerid, 1494.6826, 795.5670, 98.4995);
- if(pInfo[playerid][logged] == 0) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Use your password to log in:", "OK", ""); }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_TEAM, DIALOG_STYLE_MSGBOX, "Select Team", "Select your Team:", "US Marines", "RU Army");
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- killer[playerid] = TextDrawCreate(317.000000, 380.000000, "spielername");
- pInfo[playerid][lscore] = 0;
- TextDrawAlignment(killer[playerid],2);
- TextDrawBackgroundColor(killer[playerid], 255);
- TextDrawFont(killer[playerid], 2);
- TextDrawLetterSize(killer[playerid], 0.340000, 2.700000);
- TextDrawColor(killer[playerid], -16776961);
- TextDrawSetOutline(killer[playerid], 1);
- TextDrawSetProportional(killer[playerid], 1);
- new path[100];
- format(path, sizeof(path), "/account/%s", GetName(playerid));
- if(!dini_Exists(path))
- {
- SendClientMessage(playerid, gelb,"|_______-> Welcome at Battlefield 3 <-_______|");
- SendClientMessage(playerid, gelb,"You don't have an account. Please register.");
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Choose a password:","OK","");
- }
- else if(dini_Exists(path))
- {
- SendClientMessage(playerid, gelb,"|_______-> Welcome at Battlefield 3 <-_______|");
- SendClientMessage(playerid, gelb,"Your account is registered. Please log in.");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Use your password to log in:", "OK", "");
- }
- SetPlayerSkillLevel(playerid, 0, 1);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(pInfo[playerid][logged] == 1)
- {
- saveacc(playerid);
- SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- TextDrawHideForPlayer(playerid, killer[playerid]);
- TextDrawHideForPlayer(playerid, respawn);
- SetPlayerHealth(playerid, 100);
- pInfo[playerid][gadget] = 5;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid, playerid, reason);
- if(killerid != INVALID_PLAYER_ID)
- {
- new strg[MAX_PLAYER_NAME];
- format(strg, sizeof(strg), "%s", GetName(killerid));
- TextDrawSetString(killer[playerid], strg);
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, killerid, SPECTATE_MODE_NORMAL);
- }
- else if(killerid == INVALID_PLAYER_ID)
- {
- TextDrawSetString(killer[playerid], "SUICIDE");
- SetPlayerPos(playerid, 1490, 790, 102);
- SetPlayerCameraPos(playerid, 1494.4502, 794.5917, 99.0343);
- SetPlayerCameraLookAt(playerid, 1494.6826, 795.5670, 98.4995);
- }
- TextDrawShowForPlayer(playerid, killer[playerid]);
- pInfo[playerid][tode] +=1;
- pInfo[playerid][ltode] +=1;
- pInfo[killerid][lkills] +=1;
- pInfo[killerid][kills] +=1;
- pInfo[killerid][lscore] += 100;
- pInfo[killerid][score] += 100;
- SetPlayerScore(killerid, pInfo[killerid][lscore]);
- pInfo[killerid][spree] += 1;
- pInfo[playerid][tot] = 1;
- pInfo[playerid][deathtime] = 10;
- if(pInfo[playerid][spree] >= 3)
- {
- new str[125];
- format(str, sizeof(str), "%s ended %s's killing spree of %i kills.", GetName(killerid), GetName(playerid), pInfo[playerid][spree]);
- SendClientMessageToAll(rot, str);
- }
- if(pInfo[playerid][spree] > pInfo[playerid][longestspree])
- {
- pInfo[playerid][longestspree] = pInfo[playerid][spree];
- }
- pInfo[playerid][spree] = 0;
- switch(pInfo[killerid][klasse])
- {
- case 0: { pInfo[killerid][medickills] += 1; }
- case 1: { pInfo[killerid][pionierkills] += 1; }
- case 2: { pInfo[killerid][versorgungkills] += 1; }
- case 3: { pInfo[killerid][sniperkills] += 1; }
- }
- switch(GetPlayerWeapon(killerid))
- {
- case 31: { pInfo[killerid][m4kills] += 1; }
- case 29: { pInfo[killerid][mp5kills] += 1; }
- case 35: { pInfo[killerid][atkills] += 1; }
- case 25: { pInfo[killerid][shotgunkills] += 1; }
- case 34: { pInfo[killerid][riflekills] += 1; }
- }
- if(GetPlayerTeam(playerid) == 0)
- {
- USKills += 1;
- if(USKills >= 200)
- {
- endround(0, 1);
- }
- }
- else if(GetPlayerTeam(playerid) == 1)
- {
- RUKills += 1;
- if(RUKills >= 200)
- {
- endround(1, 0);
- }
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/carbomb", cmdtext, true))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pInfo[playerid][c4car] == 0)
- {
- new vehid = GetPlayerVehicleID(playerid);
- if(bomb[vehid] == 0)
- {
- c4model[vehid] = CreateObject(1719, 0, 0, 0, 0, 0, 0, 250);
- AttachObjectToVehicle(c4model[vehid], vehid, 0, 0, 0.2, 0, 0, 0);
- pInfo[playerid][c4car] = vehid;
- bomb[vehid] = 1;
- }
- }
- return 1;
- }
- if(!strcmp("/stats", cmdtext, true))
- {
- new stats1[120], stats2[120], stats3[120], stats4[120];
- format(stats1, sizeof(stats1), "| Name: %s | Kills: %i | Deaths: %i | Score: %i |", GetName(playerid), pInfo[playerid][lkills], pInfo[playerid][ltode], pInfo[playerid][score]);
- format(stats2, sizeof(stats2), "| Kills -> Assault: %i | Engineer: %i | Support: %i | Recon: %i |", pInfo[playerid][medickills], pInfo[playerid][pionierkills], pInfo[playerid][versorgungkills], pInfo[playerid][sniperkills]);
- format(stats3, sizeof(stats3), "| Kills -> M4: %i | MP5: %i | RPG: %i | 870MCS: %i | L96: %i |", pInfo[playerid][m4kills], pInfo[playerid][mp5kills], pInfo[playerid][atkills], pInfo[playerid][shotgunkills], pInfo[playerid][riflekills]);
- format(stats4, sizeof(stats4), "| Global -> Kills: %i | Deaths: %i | Score: %i | longest killing spree: %i | Adminlevel: %i |", pInfo[playerid][kills], pInfo[playerid][tode], pInfo[playerid][score], pInfo[playerid][longestspree], pInfo[playerid][admin]);
- SendClientMessage(playerid, gelb, "|_______-> Battlefield 3 Stats <-_______|");
- SendClientMessage(playerid, gelb, stats1);
- SendClientMessage(playerid, gelb, stats2);
- SendClientMessage(playerid, gelb, stats3);
- SendClientMessage(playerid, gelb, stats4);
- SendClientMessage(playerid, gelb, "|_______-> www.bf3fighters.com <-_______|");
- return 1;
- }
- if(!strcmp("/admins", cmdtext, true, 6))
- {
- SendClientMessage(playerid, gelb, "|_______-> Battlefield 3 Admins <-_______|");
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(pInfo[i][admin] >= 1)
- {
- new adm[30];
- format(adm, sizeof(adm), "|--> %s", GetName(i));
- SendClientMessage(playerid, gelb, adm);
- }
- }
- }
- return 1;
- }
- if(!strcmp("/gadgets", cmdtext, true))
- {
- SendClientMessage(playerid, gelb, "|_______-> Battlefield 3 Gadgets <-_______|");
- SendClientMessage(playerid, gelb, "| Assault -> Medikit -> ~k~~CONVERSATION_YES~|");
- SendClientMessage(playerid, gelb, "| Support -> C4 -> ~k~~CONVERSATION_YES~|");
- SendClientMessage(playerid, gelb, "| Recon -> MAV -> ~k~~CONVERSATION_YES~|");
- SendClientMessage(playerid, gelb, "|_______-> www.bf3fighters.com <-_______|");
- return 1;
- }
- if(!strcmp("/change", cmdtext, true))
- {
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 1490, 790, 102);
- SetPlayerCameraPos(playerid, 1494.4502, 794.5917, 99.0343);
- SetPlayerCameraLookAt(playerid, 1494.6826, 795.5670, 98.4995);
- ShowPlayerDialog(playerid, DIALOG_TEAM, DIALOG_STYLE_MSGBOX, "Select Team", "Select your Team:", "US Marines", "RU Army");
- return 1;
- }
- if(!strcmp("/credits", cmdtext, true))
- {
- SendClientMessage(playerid, gelb, "|_______-> Battlefield 3 Credits <-_______|");
- SendClientMessage(playerid, gelb, "| Scripting: ATzeGER_ | Mapping: ATzeGER_ |");
- SendClientMessage(playerid, gelb, "| BETA testing: ATzeGER_ & Pacco |");
- SendClientMessage(playerid, gelb, "| Server sponsored by 'server-free.de' |");
- SendClientMessage(playerid, gelb, "|_______-> www.bf3fighters.com <-_______|");
- return 1;
- }
- if (!strcmp("/help", cmdtext, true))
- {
- SendClientMessage(playerid, gelb, "|_______-> Battlefield 3 Help <-_______|");
- SendClientMessage(playerid, gelb, "| statistics -> '/stats' | Credits -> '/credits' |");
- SendClientMessage(playerid, gelb, "| list all available admins -> '/admins' |");
- SendClientMessage(playerid, gelb, "| change team/class/pistol -> '/change' |");
- SendClientMessage(playerid, gelb, "| Gadgethelp -> '/gadgets' |");
- SendClientMessage(playerid, gelb, "|_______-> www.bf3fighters.com <-_______|");
- return 1;
- }
- return SendClientMessage(playerid, rot, "This command does not exist.");
- }
- 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)
- {
- new str[100];
- format(str, sizeof(str), "%s has been banned. Reason: Tuning", GetName(playerid));
- SendClientMessageToAll(rot, str);
- 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(newkeys & KEY_FIRE)
- {
- if(pInfo[playerid][c4car] != 0)
- {
- new vehid = pInfo[playerid][c4car];
- new Float:xx, Float:yy, Float:zz;
- GetVehiclePos(pInfo[playerid][c4car], xx, yy, zz);
- CreateExplosion(xx, yy, zz, 10, 35);
- DestroyObject(c4model[vehid]);
- pInfo[playerid][c4car] = 0;
- bomb[vehid] = 0;
- }
- }
- if(newkeys & KEY_SECONDARY_ATTACK)
- {
- if(pInfo[playerid][tot] == 1 && pInfo[playerid][deathtime] == 0)
- {
- SpawnPlayer(playerid);
- pInfo[playerid][tot] = 0;
- TogglePlayerSpectating(playerid, 0);
- }
- }
- if(newkeys & KEY_NO)
- {
- new Float:xx, Float:yy, Float:zz;
- GetObjectPos(pInfo[playerid][c4], xx, yy, zz);
- CreateExplosion(xx, yy, zz, 10, 20);
- DestroyObject(pInfo[playerid][c4]);
- }
- if(newkeys & KEY_YES)
- {
- if(pInfo[playerid][gadget] == 5 && pInfo[playerid][tot] == 0)
- {
- switch(pInfo[playerid][klasse])
- {
- case 0:
- {
- SendClientMessage(playerid, gelb, "Medikit used.");
- new Float:xx, Float:yy, Float:zz;
- GetPlayerPos(playerid, xx, yy, zz);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 10, xx, yy, zz))
- {
- new Float:health;
- GetPlayerHealth(i, health);
- if(health <= 75)
- {
- SetPlayerHealth(i, health+15);
- new str[100];
- format(str, sizeof(str), "You got healed by %s. (+15HP)", GetName(playerid));
- SendClientMessage(i, gelb, str);
- }
- }
- }
- }
- case 2:
- {
- SendClientMessage(playerid, gelb, "C4 placed. Use ~k~~CONVERSATION_NO~ to defuse.");
- new Float:xx, Float:yy, Float:zz;
- GetPlayerPos(playerid, xx, yy, zz);
- pInfo[playerid][c4] = CreateObject(1719, xx, yy, zz, 0, 0, 0, 250);
- }
- case 3:
- {
- SendClientMessage(playerid, gelb, "MAV not available.");
- }
- }
- }
- pInfo[playerid][gadget] = 0;
- }
- 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_LOGIN:
- {
- if(response)
- {
- new path[100];
- format(path, sizeof(path), "/account/%s", GetName(playerid));
- if(!strcmp(dini_Get(path, "Password"), inputtext, false))
- {
- pInfo[playerid][logged] = 1;
- SendClientMessage(playerid, gelb, "Logged in succesfully.");
- SendDeathMessage(INVALID_PLAYER_ID, playerid, 200);
- loadacc(playerid);
- }
- else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Use your password to log in.", "OK", ""); }
- }
- return 1;
- }
- case DIALOG_REGISTER:
- {
- if(response)
- {
- if(strlen(inputtext) < 5)
- {
- SendClientMessage(playerid, rot, "[SERVER]: at least 5 characters !");
- }
- else
- {
- new path[100];
- format(path, sizeof(path), "/account/%s", GetName(playerid));
- dini_Create(path);
- dini_Set(path, "Password", inputtext);
- SendClientMessage(playerid, gelb, "Your account has been registered.");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Use your password to log in.", "OK", "");
- }
- }
- return 1;
- }
- case DIALOG_TEAM:
- {
- if(response) // US
- {
- setUS(playerid);
- }
- else if(!response) //RU
- {
- setRU(playerid);
- }
- ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose Class", "Assault\nEngineer\nSupport\nRecon", "OK", "");
- }
- case DIALOG_CLASS:
- {
- switch(listitem)
- {
- case 0: { pInfo[playerid][klasse] = 0; pInfo[playerid][gun] = 31; pInfo[playerid][sgun] = 0;} // Assault
- case 1: { pInfo[playerid][klasse] = 1; pInfo[playerid][gun] = 29; pInfo[playerid][sgun] = 35;} //Engineer
- case 2: { pInfo[playerid][klasse] = 2; pInfo[playerid][gun] = 25; pInfo[playerid][sgun] = 0;} //Support
- case 3: { pInfo[playerid][klasse] = 3; pInfo[playerid][gun] = 34; pInfo[playerid][sgun] = 0;} //Recon
- }
- ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST, "Handgun", "Desert Eagle\n9mm\n9mm (Suppressor)", "OK", "");
- }
- case DIALOG_PISTOL:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: { pInfo[playerid][pistol] = 24; } // Deagle
- case 1: { pInfo[playerid][pistol] = 22; } // 9mm
- case 2: { pInfo[playerid][pistol] = 23; } // 9mm supp
- }
- SetSpawnInfo(playerid, pInfo[playerid][team], pInfo[playerid][skin], pInfo[playerid][x], pInfo[playerid][y] , pInfo[playerid][z] , pInfo[playerid][za], pInfo[playerid][pistol], 200, pInfo[playerid][gun], 500, pInfo[playerid][sgun], 10);
- SpawnPlayer(playerid);
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(weaponid == 49)
- {
- SetPlayerHealth(playerid, 0);
- }
- if(weaponid == 34 || weaponid == 35)
- {
- SetPlayerHealth(playerid, 0);
- }
- else if(weaponid == 25)
- {
- new Float:health;
- GetPlayerHealth(playerid, health);
- SetPlayerHealth(playerid, health-75);
- }
- else if(weaponid == 24 || weaponid == 22 || weaponid == 23)
- {
- new Float:health;
- GetPlayerHealth(playerid, health);
- SetPlayerHealth(playerid, health-75);
- }
- return 1;
- }
- public todeszeit()
- {
- for(new p=0;p<MAX_PLAYERS;p++)
- {
- if(IsPlayerConnected(p))
- {
- if(pInfo[p][deathtime] > 0)
- {
- pInfo[p][deathtime] -= 1;
- if(pInfo[p][deathtime] == 0)
- {
- TextDrawShowForPlayer(p, respawn);
- }
- }
- if(pInfo[p][gadget] < 5)
- {
- pInfo[p][gadget] += 1;
- }
- }
- }
- return 1;
- }
- public newround()
- {
- for(new p=0; p<MAX_PLAYERS; p++)
- {
- if(IsPlayerConnected(p))
- {
- TextDrawHideForPlayer(p, wontxt);
- TextDrawHideForPlayer(p, losttxt);
- TextDrawHideForPlayer(p, besttxt);
- TextDrawHideForPlayer(p, playertxt);
- pInfo[p][lkills] = 0;
- pInfo[p][ltode] = 0;
- pInfo[p][lscore] = 0;
- ShowPlayerDialog(p, DIALOG_TEAM, DIALOG_STYLE_MSGBOX, "Select Team", "Select your Team:", "US Marines", "RU Army");
- }
- }
- maxscore = 0;
- return 1;
- }
- stock setUS(playerid)
- {
- TextDrawHideForPlayer(playerid, rutxt);
- TextDrawShowForPlayer(playerid, ustxt);
- pInfo[playerid][team] = 0;
- pInfo[playerid][skin] = 285;
- pInfo[playerid][x] = 994.1722;
- pInfo[playerid][y] = 1069.8273;
- pInfo[playerid][z] = 10.8203;
- pInfo[playerid][za] = 356.2719;
- SetPlayerColor(playerid, 0x0000FFFF);
- SetPlayerCameraPos(playerid, 970.4235, 1240.4116, 95.3527);
- SetPlayerCameraLookAt(playerid, 970.9746, 1239.5732, 94.9179);
- SetPlayerWorldBounds(playerid, 1797.439684947784 , 957.5556312257713, 1211.3680155903041, 864.6217242044718);
- return 1;
- }
- stock setRU(playerid)
- {
- TextDrawHideForPlayer(playerid, ustxt);
- TextDrawShowForPlayer(playerid, rutxt);
- pInfo[playerid][team] = 1;
- pInfo[playerid][skin] = 287;
- pInfo[playerid][x] = 1894.6254;
- pInfo[playerid][y] = 1180.1166;
- pInfo[playerid][z] = 10.8281;
- pInfo[playerid][za] = 139.5207;
- SetPlayerColor(playerid, 0xFF0000FF);
- SetPlayerCameraPos(playerid, 1784.3369, 1119.5081, 90.3900);
- SetPlayerCameraLookAt(playerid, 1785.2416, 1119.9426, 89.6152);
- SetPlayerWorldBounds(playerid, 1928.4216028496699, 1195.5227797803418, 1216.364031749908, 864.6217242044718);
- return 1;
- }
- stock endround(winner, looser)
- {
- SetTimer("newround", 30000, false);
- for(new p=0; p < MAX_PLAYERS; p++)
- {
- if(IsPlayerConnected(p))
- {
- TogglePlayerControllable(p, 0);
- SetPlayerPos(p, 1490, 792, 100);
- SetPlayerCameraPos(p, 1494.4502, 794.5917, 99.0343);
- SetPlayerCameraLookAt(p, 1494.6826, 795.5670, 98.4995);
- SendClientMessageToAll(rot, "Round finished.");
- if(winner == pInfo[p][team])
- {
- TextDrawShowForPlayer(p, wontxt);
- }
- else if(looser == pInfo[p][team])
- {
- TextDrawShowForPlayer(p, losttxt);
- }
- TextDrawShowForPlayer(p, besttxt);
- if(pInfo[p][score] > maxscore)
- {
- maxscore = pInfo[p][score];
- format(bestplayer, sizeof(bestplayer), "%s", GetName(p));
- }
- TextDrawSetString(playertxt, bestplayer);
- TextDrawShowForPlayer(p, playertxt);
- //stats
- new stats1[120], stats2[120], stats3[120], stats4[120];
- format(stats1, sizeof(stats1), "| Name: %s | Kills: %i | Deaths: %i | Score: %i |", GetName(p), pInfo[p][lkills], pInfo[p][ltode], pInfo[p][score]);
- format(stats2, sizeof(stats2), "| Kills -> Assault: %i | Engineer: %i | Support: %i | Recon: %i |", pInfo[p][medickills], pInfo[p][pionierkills], pInfo[p][versorgungkills], pInfo[p][sniperkills]);
- format(stats3, sizeof(stats3), "| Kills -> M4: %i | MP5: %i | RPG: %i | 870MCS: %i | L96: %i |", pInfo[p][m4kills], pInfo[p][mp5kills], pInfo[p][atkills], pInfo[p][shotgunkills], pInfo[p][riflekills]);
- format(stats4, sizeof(stats4), "| Global -> Kills: %i | Deaths: %i | Score: %i | longest killing spree: %i | Adminlevel: %i |", pInfo[p][kills], pInfo[p][tode], pInfo[p][score], pInfo[p][longestspree], pInfo[p][admin]);
- SendClientMessage(p, gelb, "|_______-> Battlefield 3 Stats <-_______|");
- SendClientMessage(p, gelb, stats1);
- SendClientMessage(p, gelb, stats2);
- SendClientMessage(p, gelb, stats3);
- SendClientMessage(p, gelb, stats4);
- SendClientMessage(p, gelb, "|_______-> www.bf3fighters.com <-_______|");
- }
- }
- return 1;
- }
- stock loadacc(playerid)
- {
- new path[100];
- format(path, sizeof(path), "/account/%s", GetName(playerid));
- pInfo[playerid][admin] = dini_Int(path, "Admin");
- pInfo[playerid][kills] = dini_Int(path, "Kills");
- pInfo[playerid][tode] = dini_Int(path, "Tode");
- pInfo[playerid][score] = dini_Int(path, "Score");
- pInfo[playerid][longestspree] = dini_Int(path, "longestspree");
- pInfo[playerid][medickills] = dini_Int(path, "medickills");
- pInfo[playerid][pionierkills] = dini_Int(path, "pionierkills");
- pInfo[playerid][versorgungkills] = dini_Int(path, "versorgungkills");
- pInfo[playerid][sniperkills] = dini_Int(path, "sniperkills");
- pInfo[playerid][m4kills] = dini_Int(path, "m4kills");
- pInfo[playerid][mp5kills] = dini_Int(path, "mp5kills");
- pInfo[playerid][atkills] = dini_Int(path, "atkills");
- pInfo[playerid][shotgunkills] = dini_Int(path, "shotgunkills");
- pInfo[playerid][c4kills] = dini_Int(path, "c4kills");
- pInfo[playerid][riflekills] = dini_Int(path, "riflekills");
- }
- stock saveacc(playerid)
- {
- if(pInfo[playerid][logged] == 1)
- {
- new path[100];
- format(path, sizeof(path), "/account/%s", GetName(playerid));
- dini_IntSet(path, "Admin", pInfo[playerid][admin]);
- dini_IntSet(path, "Kills", pInfo[playerid][kills]);
- dini_IntSet(path, "Tode", pInfo[playerid][tode]);
- dini_IntSet(path, "Score", pInfo[playerid][score]);
- dini_IntSet(path, "longestspree", pInfo[playerid][longestspree]);
- dini_IntSet(path, "medickills", pInfo[playerid][medickills]);
- dini_IntSet(path, "pionierkills", pInfo[playerid][pionierkills]);
- dini_IntSet(path, "versorgungkills", pInfo[playerid][versorgungkills]);
- dini_IntSet(path, "sniperkills", pInfo[playerid][sniperkills]);
- dini_IntSet(path, "m4kills", pInfo[playerid][m4kills]);
- dini_IntSet(path, "mp5kills", pInfo[playerid][mp5kills]);
- dini_IntSet(path, "atkills", pInfo[playerid][atkills]);
- dini_IntSet(path, "shotgunkills", pInfo[playerid][shotgunkills]);
- dini_IntSet(path, "c4kills", pInfo[playerid][c4kills]);
- dini_IntSet(path, "riflekills", pInfo[playerid][riflekills]);
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement