Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define MISSIONTIME (2) //2 minutes
- #define BOUNTYMONEY 100000
- new connectedids[MAX_PLAYERS], onlineplayers, playername[MAX_PLAYER_NAME+5], hiton = -1, recenthit = 0, bounty, bonus;
- forward NewHit();
- forward HitKilled(playerid);
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(hiton == killerid)
- {
- new pName[ MAX_PLAYER_NAME ], vName[ MAX_PLAYER_NAME ], string[ 128 ];
- GetPlayerName(killerid,pName,sizeof pName);
- GetPlayerName(playerid,vName,sizeof vName);
- GivePlayerMoney(playerid, bounty + bonus);
- format(string,sizeof string,"[HIT] {FFFFFF}%s skotose to stoxo %s kai kerdise (%d{6EF83C}${FFFFFF}) me bonus (%d{6EF83C}${FFFFFF})",pName, vName, bounty, bonus);
- SendClientMessageToAll(0x48977996,string);
- hiton = -1;
- recenthit = 0;
- }
- return 1;
- }
- CMD:peirates(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if(recenthit >= 1)
- {
- SendClientMessageToAll(COLOR_LIGHTBLUE, "Se ena lepto ksekinaei kinigi paixton! Etoimasteite!");
- SetTimer("NewHit",(1000*60*MISSIONTIME),1);
- recenthit = 0;
- }
- }
- return 1;
- }
- public NewHit()
- {
- new string[180];
- new playersid;
- bounty = random(BOUNTYMONEY);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- connectedids[onlineplayers] = i;
- onlineplayers++;
- }
- }
- GetPlayerName(connectedids[random(onlineplayers)], playername, sizeof(playername));
- playersid = GetPlayerIdFromName(playername);
- bonus = GetPlayerScore(playersid) + random(10000);
- SendClientMessageToAll(COLOR_LIGHTBLUE, "|__________Plirofories__________|");
- format(string, sizeof(string), "Stoxos: %s", playername);
- format(string, sizeof(string), "Amoivi: $%i", bounty);
- format(string, sizeof(string), "Bonus: $%i", bonus);
- SendClientMessageToAll(COLOR_LIGHTBLUE, string);
- hiton = playersid;
- return 1;
- }
- stock GetPlayerIdFromName(pname[])
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new playername2[MAX_PLAYER_NAME];
- GetPlayerName(i, playername2, sizeof(playername2));
- if(strcmp(playername2, pname, true, strlen(pname)) == 0)
- {
- return i;
- }
- }
- }
- return INVALID_PLAYER_ID;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement