Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define COLOR_GREEN 0x33AA33AA
- #define COL_GREEN "{44FF00}"
- new String[256];
- new PlayDM[MAX_PLAYERS];
- forward OnDeath(playerid);
- new Float:DMSpawns[][4] = {
- {2590.0005,2351.7432,47.4453,60.5416},
- {2464.0410,2333.7136,82.7734,5.4178},
- {2533.2700,2434.7053,54.0360,184.3093},
- {2533.4604,2324.6873,29.4766,287.0836},
- {2506.9011,2398.9487,29.4766,176.7892},
- {2601.4460,2388.3093,19.8577,129.8120},
- {2535.9763,2424.7126,14.0379,170.8592}
- };
- public OnPlayerConnect(playerid)
- {
- PlayDM[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayDM[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(PlayDM[playerid] == 1)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 10);
- new ran = random(sizeof(DMSpawns));
- SetPlayerPos(playerid, DMSpawns[ran][0], DMSpawns[ran][1], DMSpawns[ran][2]);
- SetPlayerFacingAngle(playerid, DMSpawns[ran][3]);
- GivePlayerWeapon(playerid, 34, 1500);
- }
- return 1;
- }
- CMD:sniperdm(playerid)
- {
- new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- if(PlayDM[playerid] == 0)
- {
- PlayDM[playerid] = 1;
- GameTextForPlayer(playerid,"~g~You ~r~have joined ~g~/sniperdm, ~p~to ~r~leave ~y~type ~g~/sniperdm ~y~again",6000,3);
- format(String, sizeof(String), "Server:{FFFFFF}%s(%d) has joined "COL_GREEN"SniperDM(/sniperdm)", PlayerName, playerid);
- SendClientMessageToAll(COLOR_GREEN, String);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 10);
- new ran = random(sizeof(DMSpawns));
- SetPlayerPos(playerid, DMSpawns[ran][0], DMSpawns[ran][1], DMSpawns[ran][2]);
- SetPlayerFacingAngle(playerid, DMSpawns[ran][3]);
- GivePlayerWeapon(playerid, 34, 1500);
- }
- else
- {
- PlayDM[playerid] = 0;
- GameTextForPlayer(playerid,"~g~You ~r~have left ~g~/sniperdm ~p~to ~r~join ~y~again type ~g~/sniperdm",6000,3);
- SpawnPlayer(playerid);
- SetPlayerHealth(playerid, 100);
- ResetPlayerWeapons(playerid);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid)
- {
- if(PlayDM[playerid] == 1)
- {
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- SetTimer("OnDeath",5000,false);
- }
- return 1;
- }
- public OnDeath(playerid)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 10);
- new rand = random(sizeof(DMSpawns));
- SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);
- SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
- GivePlayerWeapon(playerid, 34, 1500);
- }
Advertisement
Add Comment
Please, Sign In to add comment