Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MaxPlayers (20) // Quantidade total de player em seu servidor
- #define cX 153.1188 // Coordenada X do roubo
- #define cY -64.5729 // Coordenada Y do roubo
- #define cZ 1.5781 // Coordenada Z do roubo
- #define IconeRoubo 1274
- #define PickupCor 0x008080FF
- #define TempoRoubo 1 // Tempo em minutos para esperar o roubo ser concluído
- #define AReceber 10000 // Valor em dólares que o ladrão irá receber
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- static Roubando[MaxPlayers];
- forward Roubou(playerid);
- public OnFilterScriptInit()
- {
- print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
- print(" [FS] Roubar\n");
- print(" [KoS] Shickcard\n");
- print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
- CreatePickup(IconeRoubo, 1, cX, cY, cZ, -1);
- Create3DTextLabel("Cofre", PickupCor, cX, cY, cZ, 30.0, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i=0; i<MaxPlayers; i++)
- {
- Roubando[i] = 0;
- }
- return 1;
- }
- main()
- {
- print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
- print(" [FS] Roubar\n");
- print(" [KoS] Shickcard\n");
- print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
- }
- public OnPlayerConnect(playerid)
- {
- Roubando[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Roubando[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Roubando[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
- GetPlayerName(killerid, Matou, sizeof(Matou));
- GetPlayerName(playerid, Morreu, sizeof(Morreu));
- format(sStr, sizeof(sStr), "[NOTÍCIAS] %s[%d] matou o ladrão %s[%d]", Matou, killerid, Morreu, playerid);
- if(Roubando[playerid] == 1)
- {
- SendClientMessage(playerid, 0xE31919FF, "[~] Você morreu quando estava roubando!");
- Roubando[playerid] = 0;
- return 1;
- }
- if(Roubando[killerid] == 1)
- {
- SendClientMessage(playerid, 0xE31919FF, "[~] Você matou o ladrão!");
- Roubando[killerid] = 0;
- return 1;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(creditosfs, 10, cmdtext);
- return 0;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, cX, cY, cZ)) // Tecla » [ \| ]
- {
- static Ladrao[MAX_PLAYER_NAME], sStr[70];
- GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
- if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Você já está assaltando!");
- format(sStr, sizeof(sStr), "[NOTÍCIAS] %s[%d] está roubando um local!", Ladrao, playerid);
- SendClientMessageToAll(0xE31919FF, sStr);
- format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
- SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
- SendClientMessage(playerid, 0xC9C9C9FF, sStr);
- SetTimer("Roubou", 60000*TempoRoubo, false);
- Roubando[playerid] = 1;
- return 1;
- }
- return 1;
- }
- public Roubou(playerid)
- {
- new Grana = random(AReceber);
- static Ladrao[MAX_PLAYER_NAME], sStr[100];
- GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
- GivePlayerMoney(playerid, Grana);
- format(sStr, sizeof(sStr), "[NOTÍCIAS] A Polícia demorou e %s[%d] conseguiu roubar o local!", Ladrao, playerid);
- SendClientMessageToAll(0xE31919FF, sStr);
- Roubando[playerid] = 0;
- return 1;
- }
- dcmd_creditosfs(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid, 0xC9C9C9FF, "~. Créditos do FS a [KoS]Shickcard .~");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement