Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <a_samp>
- #include <DOF2>
- #include <zcmd>
- #include <streamer>
- #include <sscanf2>
- #if defined FILTERSCRIPT
- #define function%0(%1) forward %0(%1); public %0(%1);
- #define COLOR_RED 0xFF0000FF
- enum pInfo
- {
- Ladrao,
- Roubou
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward RoubandoCaixa(playerid);
- new Str[144];
- public OnFilterScriptInit()
- {
- //=-=-=-=-=-=-=-=-= Caixas =-=-=-=-=-=-=-=-=//
- CreateObject(2942, 2941.12231, -1023.85358, 11.41078, 0.00000, 0.00000, 86.46001);//1
- CreateObject(2942, 2941.15088, -1025.81519, 11.41078, 0.00000, 0.00000, 86.46001);//2
- CreateObject(2942, 2941.20190, -1021.55511, 11.41078, 0.00000, 0.00000, 86.46001);//3
- //=-=-=-=-=-=-=-=-= 3D =-=-=-=-=-=-=-=-=//
- Create3DTextLabel("Caixa 1'\n use:/roubar",0x5EAF03FF,2941.8210,-1025.9080,11.8258,10.0,0);//caixa1
- Create3DTextLabel("Caixa 2'\n use:/roubar",0x5EAF03FF,2941.7786,-1023.9998,11.8258,10.0,0);//caixa2
- Create3DTextLabel("Caixa 3'\n use:/roubar",0x5EAF03FF,2941.8572,-1021.6834,11.8258,10.0,0);//caixa3
- //=-=-=-=-=-=-=-=-= Pickup =-=-=-=-=-=-=-=-=//
- CreatePickup(1274, 1, 2941.8210,-1025.9080,11.8258,0);//caixa1
- CreatePickup(1274, 1, 2941.7786,-1023.9998,11.8258,0);//caixa2
- CreatePickup(1274, 1, 2941.8572,-1021.6834,11.8258,0);//caixa3
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new arquivo[34], playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(arquivo, sizeof(arquivo), "Roubos/%s", playername);
- PlayerInfo[playerid][Ladrao] = DOF2_GetInt(arquivo, "Ladrao");
- PlayerInfo[playerid][Roubou] = DOF2_GetInt(arquivo, "Roubou");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new arquivo[34], playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(arquivo, sizeof(arquivo), "Roubos/%s", playername);
- if(DOF2_FileExists(arquivo))
- {
- DOF2_SetInt(arquivo, "Ladrao", PlayerInfo[playerid][Ladrao]);
- DOF2_SetInt(arquivo, "Roubou", PlayerInfo[playerid][Roubou]);
- }
- else
- {
- DOF2_CreateFile(arquivo);
- DOF2_SetInt(arquivo, "Ladrao", PlayerInfo[playerid][Ladrao]);
- DOF2_SetInt(arquivo, "Roubou", PlayerInfo[playerid][Roubou]);
- }
- return 1;
- }
- CMD:roubar(playerid)
- {
- SetTimerEx("RoubandoCaixa", 10000, false, "i", playerid);
- GameTextForPlayer(playerid, "Roubando!", 10000, 5);
- TogglePlayerControllable(playerid,0);
- format(Str, sizeof(Str), "[ INFO ] O Player[%s][%d] Esta Roubando o banco central!", GetPlayerNameEx(playerid), playerid);
- SendClientMessageToAll(-1, Str);
- SendClientMessage(playerid, COLOR_RED, "A policia foi alertada!");
- return 1;
- }
- public RoubandoCaixa(playerid)
- {
- format(Str, sizeof(Str), "[ INFO ] O Player[%s][%d] Conseguiu Roubar o Banco Central", GetPlayerNameEx(playerid), playerid);
- SendClientMessageToAll(-1, Str);
- GivePlayerMoney(playerid, 10000);
- TogglePlayerControllable(playerid,1);
- return 1;
- }
- stock GetPlayerNameEx(playerid)
- {
- new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- return PlayerName;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement