Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sistema de Procurados | Wanted System
- Desenvolvido por: Bruno.
- */
- #include "a_samp"
- #include "zcmd"
- // Enumeradores //
- enum pwanted
- {
- w_KillsData,
- w_LevelsData,
- w_RewardData,
- w_ScoreData,
- bool:w_Wanted,
- }
- new pWantedData[MAX_PLAYERS][pwanted];
- public OnPlayerConnect(playerid)
- {
- pWantedData[playerid][w_KillsData] = 0;
- pWantedData[playerid][w_LevelsData] = 0;
- pWantedData[playerid][w_ScoreData] = 0;
- pWantedData[playerid][w_RewardData] = 0;
- pWantedData[playerid][w_Wanted] = false;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new strmsg[200], namedead[MAX_PLAYER_NAME], namekiller[MAX_PLAYER_NAME];
- SendDeathMessage(killerid, playerid, reason);
- if(killerid != INVALID_PLAYER_ID)
- {
- pWantedData[killerid][w_KillsData] ++;
- if(pWantedData[playerid][w_Wanted] == true)
- {
- GetPlayerName(killerid, namekiller, sizeof namekiller);
- GetPlayerName(playerid, namedead, sizeof namedead);
- GivePlayerMoney(killerid, pWantedData[playerid][w_RewardData]);
- SetPlayerScore(killerid, pWantedData[playerid][w_ScoreData]);
- format(strmsg, sizeof strmsg, "{00FF00}Procurados | {87CEFA}O cacador de procurados '%s' matou o matador de noobs '%s'! (Recompensas: Dinheiro %d | Score: %d)", namekiller, namedead, pWantedData[playerid][w_RewardData], pWantedData[playerid][w_ScoreData]);
- SendClientMessageToAll(-1, strmsg);
- }
- }
- ws_CheckKills(killerid);
- pWantedData[playerid][w_Wanted] = false;
- pWantedData[playerid][w_KillsData] = 0;
- pWantedData[playerid][w_LevelsData] = 0;
- pWantedData[playerid][w_ScoreData] = 0;
- pWantedData[playerid][w_RewardData] = 0;
- SetPlayerWantedLevel(playerid, 0);
- return 1;
- }
- //Funçoes
- ws_CheckKills(killerid)
- {
- new ws_StringKills[500];
- if(pWantedData[killerid][w_KillsData] == 10 || pWantedData[killerid][w_KillsData] == 20 || pWantedData[killerid][w_KillsData] == 30 || pWantedData[killerid][w_KillsData] == 40 || pWantedData[killerid][w_KillsData] == 50)
- {
- pWantedData[killerid][w_Wanted] = true;
- pWantedData[killerid][w_LevelsData] ++;
- pWantedData[killerid][w_RewardData] += 10000;
- pWantedData[killerid][w_ScoreData] += 5;
- new name[MAX_PLAYER_NAME];
- GetPlayerName(killerid, name, sizeof name);
- format(ws_StringKills, sizeof ws_StringKills, "{00FF00}Procurados | {87CEFA}O(a) miseravel do(a) %s, ja matou '%d' noobs sem morrer!, o(a) maluco(a) é foda! {FFFF00}(/procurados)", name, pWantedData[killerid][w_KillsData]);
- SendClientMessageToAll(-1, ws_StringKills);
- SetPlayerWantedLevel(killerid, pWantedData[killerid][w_LevelsData]);
- }
- return 1;
- }
- // Comandos
- //Comando de teste (pode remover sem poblemas.)
- CMD:arma(playerid)
- {
- GivePlayerWeapon(playerid, 24, 2000);
- GivePlayerWeapon(playerid, 26, 2999);
- GivePlayerWeapon(playerid, 29, 2000);
- return 1;
- }
- CMD:procurados(playerid)
- {
- new str_procurados[1024], string[600], namewanteds[MAX_PLAYER_NAME];
- strins(str_procurados, "Nomes\t Estrelas\t Recompensa\tScore\n", strlen(str_procurados));
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && pWantedData[i][w_KillsData] >= 10)
- {
- GetPlayerName(i, namewanteds, sizeof namewanteds);
- format(string, sizeof string, "{87CEFA}%s\t {87CEFA}%d\t{7FFF00}R$ {87CEFA}%d\t{87CEFA}%d\n", namewanteds, pWantedData[i][w_LevelsData], pWantedData[i][w_RewardData], pWantedData[i][w_ScoreData]);
- strcat(str_procurados, string);
- }
- }
- ShowPlayerDialog(playerid, 2001, DIALOG_STYLE_TABLIST_HEADERS, "Procurados", str_procurados, "Fechar", "");
- return 1;
- }
Add Comment
Please, Sign In to add comment