[Ajuda] Converter para ZCMD
#4

Vejam se estб correto principalmente o Primeiro CMD.
pawn Код:
CMD:v(playerid, params[]) {
    if(IsPlayerConnected(playerid))
    {
        new x_nr[64];
        new tmp;
        if(sscanf(params, "d", tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "HINT: (/v)ehicle [name]");
            SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lockmycar, unlockmycar, locate");
            return 1;
        }
        if(strcmp(x_nr,"lockmycar",true) == 0)
        {
            new keycar = (DOF2_GetInt(PFile(playerid),"HaveCar"));
            new personalcar = (DOF2_GetInt(PFile(playerid),"CarID"));
            if(keycar == 1)
            {
                new locked[256];
                locked = strtok(cmdtext, idx);
                if (VehicleSystem[GetCreatorID(personalcar)][cLock]==1)
                {
                    for(new i = 0; i < SLOTS; i++)
                    {
                        if (IsPlayerConnected(i))
                        {
                            SetVehicleParamsForPlayer(personalcar,i,0,1);
                        }
                    }
                    format(string, sizeof(string), "~w~Vehicle~n~~g~Locked");
                    GameTextForPlayer(playerid, string, 4000, 3);
                    VehicleSystem[GetCreatorID(personalcar)][cLock]=0;
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string,sizeof(string), "* %s has locked his personal vehicle, using his car key!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SaveTool();
                    return 1;
                }
            }
        }
        else if(strcmp(x_nr,"unlockmycar",true) == 0)
        {
            new keycar = (DOF2_GetInt(PFile(playerid),"HaveCar"));
            new personalcar = (DOF2_GetInt(PFile(playerid),"CarID"));
            if(keycar == 1)
            {
                new locked[256];
                locked = strtok(cmdtext, idx);
                if (VehicleSystem[GetCreatorID(vehicleid)][cLock]==0)
                {
                    for(new i = 0; i < SLOTS; i++)
                    {
                        if (IsPlayerConnected(i))
                        {
                            SetVehicleParamsForPlayer(personalcar,i,0,0);
                        }
                    }
                    format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
                    GameTextForPlayer(playerid, string, 4000, 3);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string,sizeof(string), "* %s has unlocked his personal vehicle, using his car key!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    VehicleSystem[GetCreatorID(personalcar)][cLock]=1;
                    SaveTool();
                    return 1;
                }
            }
        }
        else if(strcmp(x_nr,"park",true) == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid)){return 1;}
            if(GetCreatorID(vehicleid)!=0)
            {
                if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
                {
                    new Float:vx,Float:vy,Float:vz,Float:va;
                    GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
                    GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
                    VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
                    VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
                    VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
                    VehicleSystem[GetCreatorID(vehicleid)][a]=va;
                    SetVehicleHealth(GetPlayerVehicleID(playerid),100.0);
                    SendClientMessage(playerid,WHITE,"You have parked your vehicle here!");
                    SendClientMessage(playerid,YELLOW,"Your vehicle will now respawn here!");
                    SaveTool();
                }
            }
            return 1;
        }
        else if(strcmp(x_nr,"locate",true) == 0)
        {
            if(!IsPlayerConnected(playerid)) { return 1; }
            new Float:xxx,Float:yyy,Float:zzz;
            new keycar = (DOF2_GetInt(PFile(playerid),"HaveCar"));
            new personalcar = (DOF2_GetInt(PFile(playerid),"CarID"));
            if(keycar == 0) { GameTextForPlayer(playerid, "~w~You haven's got a car to find", 2500, 3); return 1; }
            SendClientMessage(playerid,COLOR_WHITE,"Your car has been found!");
            GetVehiclePos(personalcar, xxx, yyy, zzz);
            SetPlayerCheckpoint(playerid, xxx, yyy, zzz, 6);
            return 1;
        }
    }
    return 1;
}

CMD:removeveh(playerid) {
    if(!IsPlayerInAnyVehicle(playerid)){return 1;}
    if(!IsPlayerAdmin(playerid)){return 1;}
    VehicleSystem[GetCreatorID(vehicleid)][model]=0;
    VehicleSystem[GetCreatorID(vehicleid)][owned]=0;
    VehicleSystem[GetCreatorID(vehicleid)][x]=(0.0);
    VehicleSystem[GetCreatorID(vehicleid)][y]=(0.0);
    VehicleSystem[GetCreatorID(vehicleid)][z]=(0.0);
    VehicleSystem[GetCreatorID(vehicleid)][Farbe1]=0;
    VehicleSystem[GetCreatorID(vehicleid)][Farbe2]=0;
    VehicleSystem[GetCreatorID(vehicleid)][preis]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod1]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod2]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod3]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod4]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod5]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod6]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod7]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod8]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod9]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod10]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod11]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod12]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod13]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod14]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod15]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod16]=0;
    VehicleSystem[GetCreatorID(vehicleid)][mod17]=0;
    VehicleSystem[GetCreatorID(vehicleid)][paintjob]=0;
    VehicleSystem[GetCreatorID(vehicleid)][cLock]=1;
    strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],"",0,128,128);
    IDIS[vehicleid]=0;
    DestroyVehicle(vehicleid);
    SaveTool();
    return 1;
}
CMD:newbuycar(playerid, params[]) {
    if(!IsPlayerAdmin(playerid)){return 1;}
    new carro, cor1, cor2, SNAPreco;
    if(sscanf(params, "dddd", carro, cor1, cor2, SNAPreco))
        return SCM(playerid, COR_CINZA1, "Use: /newbuycar [id do carro] [cor 1] [cor 2] [preзo]");
    new price = strval(tmp);
    new Float:px,Float:py,Float:pz,Float:pa;
    GetPlayerPos(playerid,px,py,pz);
    GetPlayerFacingAngle(playerid,pa);
    created++;
    VehicleSystem[created][model]=vehiclemodel;
    VehicleSystem[created][x]=px;
    VehicleSystem[created][y]=py;
    VehicleSystem[created][z]=pz;
    VehicleSystem[created][a]=pa;
    VehicleSystem[created][Farbe1]=color1;
    VehicleSystem[created][Farbe2]=color2;
    VehicleSystem[created][preis]=price;
    VehicleSystem[created][owned]=0;
    VehicleSystem[created][cLock]=1;
    strmid(VehicleSystem[created][owner],"dealercar",0,128,128);
    new ccar = CreateVehicle(VehicleSystem[created][model],VehicleSystem[created][x],VehicleSystem[created][y],VehicleSystem[created][z],VehicleSystem[created][a],VehicleSystem[created][Farbe1],VehicleSystem[created][Farbe2],600000);
    IDIS[ccar]=created;
    SaveTool();
    return 1;
}
CMD:buyveh(playerid) {
    /*if(DOF2_GetInt(PFile(playerid),"HaveCar")== 1) return SendClientMessage(playerid,ORANGE,"[ERROR]You already have a Car");*/
    /*if(DOF2_GetInt(PFile(playerid),"HaveCar")== 1) { }
    else { SendClientMessage(playerid, ORANGE,"[ERROR]You already have a Car"); return 1; }*/

    new HaveCar = (DOF2_GetInt(PFile(playerid),"HaveCar"));
    if(!IsPlayerInAnyVehicle(playerid)){return 1;}
    if(GetCreatorID(vehicleid)!=0)
    {
        if(HaveCar == 0)
        {
            if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid))){SendClientMessage(playerid,WHITE," Aceasta masina este deja cumparata!");return 1;}
            if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar"))
            {
                if(VehicleSystem[GetCreatorID(vehicleid)][preis] < GetPlayerMoney(playerid))
                {
                    strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid),0,128,128);
                    VehicleSystem[GetCreatorID(vehicleid)][owned]=1;
                    SetVehicleNumberPlate(vehicleid, VehicleSystem[GetCreatorID(vehicleid)][owner]);
                    GivePlayerMoney(playerid,-VehicleSystem[GetCreatorID(vehicleid)][preis]);
                    SendClientMessage(playerid,YELLOW," Congratulations with your new purchase!");
                    SendClientMessage(playerid,WHITE," You can see your personal car commands by using /carhelp");
                    TogglePlayerControllable(playerid,1);
                    Delete3DTextLabel(TextUpCar[vehicleid]);
                    SaveTool();
                }
                else
                {
                    SendClientMessage(playerid,WHITE,"You don't have enough cash with you!");
                }
            }
            else
            {
                SendClientMessage(playerid,WHITE,"This car is not for sale!");
            }
        }
        else
        {
            SendClientMessage(playerid, ORANGE,"[ERROR]You already have a Car");
        }
    }
    else
    {
        SendClientMessage(playerid,WHITE,"It's not for sale!");
    }
    if(!DOF2_FileExists(PFile(playerid)))
    {
        DOF2_CreateFile(PFile(playerid));
        DOF2_SetInt(PFile(playerid),"HaveCar",1);
        DOF2_SetInt(PFile(playerid),"CarID",vehicleid);
    }
    else if(DOF2_FileExists(PFile(playerid)))
    {
        DOF2_SetInt(PFile(playerid),"HaveCar",1);
        DOF2_SetInt(PFile(playerid),"CarID",vehicleid);
    }
    return 1;
}

CMD:sellveh(playerid, params[]) {
    if(!IsPlayerInAnyVehicle(playerid)){return 1;}
    if(GetCreatorID(vehicleid)!=0)
    {
        if (IsPlayerAdmin(playerid))
        {
            new SNAPrice;
            if(sscanf(params, "d",SNAPrice))
                return SCM(playerid, COR_CINZA1, "Use: /sellveh [price]");
            new Float:vx,Float:vy,Float:vz,Float:va;
            GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
            GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
            VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
            VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
            VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
            VehicleSystem[GetCreatorID(vehicleid)][a]=va;
            VehicleSystem[GetCreatorID(vehicleid)][preis]=strval(tmp);
            VehicleSystem[GetCreatorID(vehicleid)][owned]=0;
            VehicleSystem[GetCreatorID(vehicleid)][cLock]=1;
            strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar",0,128,128);
            SendClientMessage(playerid,WHITE,"This Car Is Now For Sale!");
            SaveTool();
            Delete3DTextLabel(TextUpCar[vehicleid]);
            format(TextCar,sizeof(TextCar),"This car is for sale, price: %d",VehicleSystem[GetCreatorID(vehicleid)][preis]);
            TextUpCar[vehicleid] = Create3DTextLabel(TextCar, 0xFFFFFFAA ,0,0,0,20.0,0);
            Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
        }
        else
        {
            SendClientMessage(playerid,WHITE,"INFO: Nu esti admin ca sa poti vinde masini!");
        }
    }
    return 1;
}
CMD:apark(playerid) {
    if(!IsPlayerInAnyVehicle(playerid)){return 1;}
    if(!IsPlayerAdmin(playerid)){return 1;}
    if(GetCreatorID(vehicleid)!=0)
    {
        new Float:vx,Float:vy,Float:vz,Float:va;
        GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
        GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
        VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
        VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
        VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
        VehicleSystem[GetCreatorID(vehicleid)][a]=va;
        SendClientMessage(playerid,WHITE,"Admin Park!");
        SaveTool();
    }
    else
    {
        SendClientMessage(playerid,WHITE," You Can't Park This Car!");
    }
    return 1;
}
CMD:exitcar(playerid) {
    if(!IsPlayerInAnyVehicle(playerid)){return 1;}
    if(GetCreatorID(vehicleid)!=0)
    {
        TogglePlayerControllable(playerid, 1);
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
CMD:carhelp(playerid) {
    SendClientMessage(playerid, 0x33AA33AA, "_______________________________________");
    SendClientMessage(playerid, 0xFFFFFFAA, "*** HELP *** Your Vehicle Commands");
    SendClientMessage(playerid, 0xCBCCCEFF, "*** CAR *** type /v to view your personal car commands!");
    return 1;
}
CMD:deleteowner(playerid, params[]) {
    if ((IsPlayerAdmin(playerid)))
    {
        if(sscanf(params, "u", iddele))
            return SCM(playerid, COR_CINZA, "Use: /deleteowner [id]");
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string,sizeof(string),"Users/%s.ini",tmp);
        DOF2_RemoveFile(string);
        SendClientMessage(playerid, ORANGE, "Car Owner Deleted");
    }
    return 1;
}
Reply


Messages In This Thread
Converter para ZCMD - by sonmook - 06.01.2015, 03:53
Re: Converter para ZCMD - by Bruno13 - 06.01.2015, 05:22
Re: Converter para ZCMD - by WLSF - 06.01.2015, 10:27
Re: Converter para ZCMD - by sonmook - 06.01.2015, 12:23
Re: Converter para ZCMD - by [BOPE]Seu._.Madruga - 06.01.2015, 16:15

Forum Jump:


Users browsing this thread: 2 Guest(s)