Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************
- Criado por Scorpion
- ************************************/
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <DOF2>
- #include <streamer>
- #define Plant "Plant/%s.ini"
- //variaveis
- enum checar{
- pNasceu,
- qMaconhas,
- sementes,
- Vendedor,
- lColher
- };
- new Float:xx1[MAX_PLAYERS], Float:yy1[MAX_PLAYERS], Float:zz1[MAX_PLAYERS], Text3D:TextLabel[MAX_PLAYERS];
- new PlayerInfo[MAX_PLAYERS][checar];
- new p1[MAX_PLAYERS], p2[MAX_PLAYERS], p3[MAX_PLAYERS], p4[MAX_PLAYERS];
- new bool:Checar[MAX_PLAYERS];
- //------------------------------------------------
- public OnFilterScriptInit()
- {
- CreateActor(1, -1004.7302,-1076.6400,130.3164,88.4122);
- CreateObject(18259, -1006.71204, -1076.41211, 129.21440, 0.01930, -0.46160, -3.53840);
- Create3DTextLabel("Digite {00FF00}/ajudamaconha", -1, -1004.7302,-1076.6400,130.3164, 7, 0, 0);
- printf("\n-------->Plantacao de Maconha Iniciada<--------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if( !DOF2_FileExists(arquivo(playerid)) && !IsPlayerNPC(playerid) ){
- DOF2_CreateFile(arquivo(playerid));
- DOF2_SetInt( arquivo( playerid ), "Vendedor", 0);
- DOF2_SetInt( arquivo( playerid ), "qMaconhas", 0);
- DOF2_SetInt( arquivo( playerid ), "sementes", 0);
- DOF2_SaveFile();
- }
- PlayerInfo[playerid][pNasceu] = 0;
- Carregar(playerid);
- return 0;
- }
- stock Carregar(playerid)
- {
- PlayerInfo[playerid][Vendedor] = DOF2_GetInt( arquivo(playerid), "Vendedor" );
- PlayerInfo[playerid][qMaconhas] = DOF2_GetInt( arquivo(playerid), "qMaconhas" );
- PlayerInfo[playerid][sementes] = DOF2_GetInt( arquivo(playerid), "sementes" );
- DOF2_SaveFile();
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerInfo[playerid][pNasceu] = 0;
- PlayerInfo[playerid][lColher] = 0;
- Checar[playerid] = false;
- DestroyDynamicObject(p1[playerid]);
- DestroyDynamicObject(p2[playerid]);
- DestroyDynamicObject(p3[playerid]);
- DestroyDynamicObject(p4[playerid]);
- Delete3DTextLabel(TextLabel[playerid]);
- Salvar(playerid);
- PlayerInfo[playerid][pNasceu] = 0;
- RemovePlayerAttachedObject(playerid, 3);
- return 0;
- }
- stock Salvar(playerid)
- {
- DOF2_SetInt(arquivo(playerid), "Vendedor", PlayerInfo[playerid][Vendedor]);
- DOF2_SetInt(arquivo(playerid), "qMaconhas", PlayerInfo[playerid][qMaconhas]);
- DOF2_SetInt(arquivo(playerid), "sementes", PlayerInfo[playerid][sementes]);
- DOF2_SaveFile();
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(Checar[playerid]){
- DisablePlayerCheckpoint(playerid);
- }
- return 0;
- }
- CMD:vendermaconha(playerid)
- {
- new Float:pos[3], msg[128];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(PlayerInfo[playerid][Vendedor] == 0) return SendClientMessage(playerid, -1, "{FF0000}Você não é vendedor de maconha, digite /ajudamaconha!");
- if(PlayerInfo[playerid][qMaconhas] == 0) return SendClientMessage(playerid, -1, "{FF0000}Você não tem maconhas colhidas!");
- if(pos[0] >= -1011.1290 && pos[0] <= -1002.2682 && pos[1] <= -1070.0612 && pos[1] >= -1084.9889){
- new valor = PlayerInfo[playerid][qMaconhas] * 300;
- GivePlayerMoney(playerid, valor);
- format(msg, 128, "Você vendeu sua(s) maconha(s) e ganhou %d reais!", valor);
- SendClientMessage(playerid, 0x00FF00FF, msg);
- PlayerInfo[playerid][qMaconhas] = 0;
- }else{
- SendClientMessage(playerid, 0xFF0000FF, "Você não está na cabanda, digite /cabana para encontra-la!");
- }
- return 1;
- }
- CMD:pegaremprego(playerid)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(PlayerInfo[playerid][Vendedor] == 1) return SendClientMessage(playerid, 0xFF0000FF, "Você já é vendedor de maconha!");
- if(pos[0] >= -1011.1290 && pos[0] <= -1002.2682 && pos[1] <= -1070.0612 && pos[1] >= -1084.9889){
- PlayerInfo[playerid][Vendedor] = 1;
- SendClientMessage(playerid, 0x00FF00FF, "Parabéns, agora você é um vendedor de maconhas!");
- }else{
- SendClientMessage(playerid, 0xFF0000FF, "Você não está na cabana, digite /cabana para encontra-la!");
- }
- return 1;
- }
- CMD:pedircontas(playerid)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(PlayerInfo[playerid][Vendedor] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Você não é vendedor de maconhas para usar este comando!");
- if(pos[0] >= -1011.1290 && pos[0] <= -1002.2682 && pos[1] <= -1070.0612 && pos[1] >= -1084.9889){
- PlayerInfo[playerid][Vendedor] = 0;
- SendClientMessage(playerid, 0x00FF00FF, "Emprego deixado com sucesso!");
- }else{
- SendClientMessage(playerid, 0xFF0000FF, "Você não está na cabana, digite /cabana para encontra-la!");
- }
- return 1;
- }
- CMD:cabana(playerid)
- {
- SetPlayerCheckpoint(playerid, -1004.7302,-1076.6400,130.3164, 3.0);
- SendClientMessage(playerid, 0x00FF00FF, "CheckPoint criado! Siga a marcação vermelha em seu radar!");
- Checar[playerid] = true;
- return 1;
- }
- CMD:comprarsementes(playerid)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(PlayerInfo[playerid][Vendedor] == 0) return SendClientMessage(playerid, -1, "{FF0000}Você não é vendedor de maconha, digite /ajudamaconha!");
- if(din(playerid) < 100) return SendClientMessage(playerid, -1, "{FF0000}Você não tem dinheiro para comprar sementes! valor 100R$");
- if(pos[0] >= -1011.1290 && pos[0] <= -1002.2682 && pos[1] <= -1070.0612 && pos[1] >= -1084.9889){
- GivePlayerMoney(playerid, -100);
- PlayerInfo[playerid][sementes] = PlayerInfo[playerid][sementes] + 5;
- SendClientMessage(playerid, 0x00FF00FF, "Você comprou 5 sementes! Agora você pode plantar!");
- }else{
- SendClientMessage(playerid, 0xFF0000FF, "Você não está na cabana, digite /cabana para encontra-la!");
- }
- return 1;
- }
- CMD:plantarmaconha(playerid)
- {
- new msgmaconha[128];
- if(PlayerInfo[playerid][Vendedor] == 0) return SendClientMessage(playerid, -1, "{FF0000}Você não é vendedor de maconha, digite /ajudamaconha!");
- if(PlayerInfo[playerid][sementes] <= 0) return SendClientMessage(playerid, -1, "{FF0000}Você não tem sementes, digite /ajudamaconha!");
- if(PlayerInfo[playerid][pNasceu] != 2 && PlayerInfo[playerid][pNasceu] != 1){
- if(!IsPlayerInAnyVehicle(playerid)){
- GetPlayerPos(playerid, xx1[playerid], yy1[playerid], zz1[playerid]);
- if ( xx1[playerid] >= -1190.2493 && xx1[playerid] <= -1006.7014 && yy1[playerid] <= -915.4045 && yy1[playerid] >= -1062.7966 ){
- ApplyAnimation(playerid,"BOMBER","BOM_Plant_Loop",2.0,1,0,0,0,3000);
- SendClientMessage(playerid, -1, "{00FF00}Você acaba de plantar uma maconha!");
- p1[playerid] = CreateDynamicObject(822, xx1[playerid]+1, yy1[playerid]+1, 120, 0, 0, 0, 0, 0, 10000);
- p2[playerid] = CreateDynamicObject(822, xx1[playerid]-1, yy1[playerid]+1, 120, 0, 0, 0, 0, 0, 10000);
- p3[playerid] = CreateDynamicObject(822, xx1[playerid]-1, yy1[playerid]-1, 120, 0, 0, 0, 0, 0, 10000);
- p4[playerid] = CreateDynamicObject(822, xx1[playerid]+1, yy1[playerid]-1, 120, 0, 0, 0, 0, 0, 10000);
- PlayerInfo[playerid][pNasceu] = 1;
- format(msgmaconha, sizeof(msgmaconha), "{FFFFFF}Esta Plantação Pertence a\n{00FF00}%s", Name(playerid));
- TextLabel[playerid] = Create3DTextLabel(msgmaconha, -1, xx1[playerid], yy1[playerid], zz1[playerid], 60, 0, 0);
- GameTextForPlayer(playerid, "~g~PLANTANDO...", 1500, 1);
- PlayerInfo[playerid][sementes] --;
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não está na area de plantação!");}
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não pode plantar maconha em um veículo!");}
- }else{SendClientMessage(playerid, -1, "{FF0000}Você já tem uma plantação pendente!");}
- return 1;
- }
- CMD:regar(playerid)
- {
- if(PlayerInfo[playerid][pNasceu] == 1){
- if(IsPlayerInRangeOfPoint(playerid, 3, xx1[playerid], yy1[playerid], zz1[playerid])){
- ApplyAnimation(playerid,"BOMBER","BOM_Plant_Loop",2.0,1,0,0,0,3000);
- MoveDynamicObject(p1[playerid], xx1[playerid]+1, yy1[playerid]+1, 128.68871, 0.05);
- MoveDynamicObject(p2[playerid], xx1[playerid]-1, yy1[playerid]+1, 128.68871, 0.05);
- MoveDynamicObject(p3[playerid], xx1[playerid]-1, yy1[playerid]-1, 128.68871, 0.05);
- MoveDynamicObject(p4[playerid], xx1[playerid]+1, yy1[playerid]-1, 128.68871, 0.05);
- SendClientMessage(playerid, 0x00FF00FF, "Você regou sua plantação, espere a plantação nascer!");
- GameTextForPlayer(playerid, "~g~REGADO", 2000, 1);
- PlayerInfo[playerid][pNasceu] = 2;
- PlayerInfo[playerid][lColher] = gettime() + 173;
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não esta perto de suas plantações!");}
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não tem plantações para regar!");}
- return 1;
- }
- CMD:colhermaconha(playerid)
- {
- if(PlayerInfo[playerid][lColher] > gettime()) return SendClientMessage(playerid, -1, "{FF0000}Sua plantação ainda não nasceu ou você não tem plantações!");
- if(!IsPlayerInAnyVehicle(playerid)){
- if(IsPlayerInRangeOfPoint(playerid, 3, xx1[playerid], yy1[playerid], zz1[playerid])){
- if(PlayerInfo[playerid][pNasceu] == 2)
- {
- DestroyDynamicObject(p1[playerid]);
- DestroyDynamicObject(p2[playerid]);
- DestroyDynamicObject(p3[playerid]);
- DestroyDynamicObject(p4[playerid]);
- SendClientMessage(playerid, 0x00FF00FF, "Você colheu sua plantação, vá na cabana e digite /vendermaconha!");
- Delete3DTextLabel(TextLabel[playerid]);
- PlayerInfo[playerid][pNasceu] = 0;
- PlayerInfo[playerid][qMaconhas] ++;
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não tem Plantações ou sua plantação ainda não nasceu!");}
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não está perto da plantação!");}
- }else{SendClientMessage(playerid, -1, "{FF0000}Você não pode colher maconha em um veículo!");}
- return 1;
- }
- CMD:infomaconha(playerid)
- {
- new txt[64], txt2[64], txt3[64], vr = PlayerInfo[playerid][pNasceu];
- switch(vr){
- case 0:{format(txt, 64, "Você não tem maconhas plantadas!");}
- case 1:{format(txt, 64, "Você tem uma maconha que precisa ser regada!");}
- case 2:{format(txt, 64, "Você tem uma maconha que está nascendo ou já nasceu!");}
- }
- SendClientMessage(playerid, -1, "--------------------------");
- SendClientMessage(playerid, 0xFFF000FF, txt);
- format(txt2, sizeof(txt2), "{FFF000}Você tem %d maconha(s) colhida(s)", PlayerInfo[playerid][qMaconhas]);
- format(txt3, sizeof(txt3), "{FFF000}Você tem %d semente(s)", PlayerInfo[playerid][sementes]);
- SendClientMessage(playerid, -1, txt2);
- SendClientMessage(playerid, -1, txt3);
- SendClientMessage(playerid, -1, "--------------------------");
- return 1;
- }
- CMD:ajudamaconha(playerid)
- {
- SendClientMessage(playerid, -1, "Se você não é vendedor de maconha, vá até a cabana e digite /pegaremprego!");
- SendClientMessage(playerid, -1, "Para saber onde se encontra a cabana digite: {00FF00}/cabana");
- SendClientMessage(playerid, -1, "{00FF00}Comandos: {FFFFFF}/plantarmaconha, /colhermaconha, /infomaconha, /comprarsementes");
- return 1;
- }
- stock Name(playerid)
- {
- new nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
- return nome;
- }
- stock din(playerid)
- {
- new dinheiro;
- dinheiro = GetPlayerMoney(playerid);
- return dinheiro;
- }
- stock arquivo(playerid)
- {
- new ArquivoPlayer[30];
- format(ArquivoPlayer, sizeof(ArquivoPlayer), Plant, Name(playerid));
- return ArquivoPlayer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement