[POMOC] Sellcarto

Započeo Danisha, Septembar 05, 2012, 17:30:05 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim:RAvesn preradjeni
Detaljan opis problema:Mozel neko da mi prebaci ovu komandu iz ZCMD u SSCANF molim vas hitno mi je
MODERATORI NEMOJTE LOCK DOK MI NEKO NE POMOGNE MOLIM VAS
Dio skripte:
CMD:sellcarto(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SCM(playerid, COLOR_GREY, "   Morate prvo da se ulogujete! ");
return 1;
}
new string[128],sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername,sizeof(sendername));
new giveplayerid, giveplayer[MAX_PLAYER_NAME],price;
if(sscanf(params,"ud",giveplayerid,price)) return SCM(playerid, COLOR_WHITE, "SAVET: /sellcarto [playerID/DeoImena] [cena]");
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2])
{
new ownvehkey;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { ownvehkey = PlayerInfo[playerid][pCarKey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { ownvehkey = PlayerInfo[playerid][pCarKey2]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(PlayerInfo[giveplayerid][pCarKey] == 9999)
{
if(price < 1 || price > 1500000)
{
SCM(playerid, COLOR_GREY, "  Price not lower then 1 and not higher then 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (kucajte /accept ownablecar) to buy.", sendername, price);
SCM(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else if(PlayerInfo[giveplayerid][pCarKey2] == 9999)
{
if(price < 1 || price > 1500000)
{
SCM(playerid, COLOR_GREY, "  Price not lower then 1 and not higher then 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (kucajte /accept ownablecar) to buy.", sendername, price);
SCM(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else
{
SCM(playerid, COLOR_GREY, "Igrac vec ima dva vozila");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY, "   Player is not near you ! ");
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, "  Vi niste vlasnik ovog vozila");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY, "  You have to sit at your own car to sell it");
return 1;
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno)://///



KOJI VRAG MI TO STAVLJAS AKO ZNAS I OCES POMOZ AKO NEZNAS OLADI

Ali ako znas izmeni ja ti imam preko /v
if(strcmp(cmd, "/v", true) == 0) // By LordMan
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Ti mora da se logiras prvo ! ");
            return 1;
        }
        new x_nr[64];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
SendClientMessage(playerid, COLOR_WHITE, "SOVET: (/v)ehicle [ime]");
            SendClientMessage(playerid, COLOR_WHITE, "Dostapni iminja: lock, sell, sellto, color, paintjob, setcode, find.");
SendClientMessage(playerid, COLOR_WHITE, "Napisete {157DEC}/vozilo {FFFFFF}i na {FF0000}ednostaven {FFFFFF}nacin upravuvajte so vaseto vozilo.");
            return 1;
        }
        if(strcmp(x_nr,"sell",true) == 0)
        {
            if(IsAtDealership(playerid))
            {
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
                {
                    new ownvehkey;
                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
                    else { return 1; }
                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                    {
                        new carsellprice = GetVehiclePrice(ownvehkey) / 4 * 4;
                        SafeGivePlayerMoney(playerid,carsellprice);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "~w~Go prodadovte vasiot avtomobil za: ~n~~g~$%d", carsellprice);
                        GameTextForPlayer(playerid, string, 10000, 3);

                        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
PlayerInfo[playerid][pPcarkey] = 9999;
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
PlayerInfo[playerid][pPcarkey2] = 9999;
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
PlayerInfo[playerid][pPcarkey3] = 9999;
SafeRemovePlayerFromVehicle(playerid);
CarInfo[ownvehkey][cOwned] = 0;
CarInfo[ownvehkey][cOwner] = Drzava;
CarInfo[ownvehkey][cLocationx] = 1590.3740;
CarInfo[ownvehkey][cLocationy] = -1026.0565;
CarInfo[ownvehkey][cLocationz] = 23.9063;
CarInfo[ownvehkey][cAngle] = 317.1649;
CarInfo[ownvehkey][cReg] = 0;
DestroyVehicle(ownvehkey);
                        TogglePlayerControllable(playerid, 1);
OnPropUpdate(4,ownvehkey);
                        OnPlayerUpdateEx(playerid);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Morate da sedite vo vaseto vozilo za da go prodadete! ");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Ne ste vo prodavnicata za avtomobili!");
                return 1;
            }
        }
        else if(strcmp(x_nr,"sellto",true) == 0)
        {
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
    new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [price]");
    return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
    if(ProxDetectorS(8.0, playerid, giveplayerid))
        {
    if(PlayerInfo[giveplayerid][pPcarkey] == 9999)
    {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [price]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1500000)
            {
                SendClientMessage(playerid, COLOR_GREY, "  Parite ne smeeat da bida pomalku od 1 nitu pogolemi od 1500000. ");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "* Ti mu ponudi na %s da go kupi tvoeto vozilo za $%d .", giveplayer, price);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* Gazdata na voziloto %s ti ponudi da go kupis negovoto vozilo za $%d (Napisete /accept ownablecar) za da go kupite.", playername, price);
        SendClientMessage(giveplayerid, COLOR_WHITE, string);
        OwnableCarOffer[giveplayerid] = playerid;
        OwnableCarID[giveplayerid] = ownvehkey;
        OwnableCarPrice[giveplayerid] = price;
        return 1;
        }
else if(PlayerInfo[giveplayerid][pPcarkey2] == 9999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [pari]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, "  Parite ne smeeat da bida pomalku od 1 nitu pogolemi od 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Ti mu ponudi na %s da go kupi tvoeto vozilo za $%d.", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Gazdata na voziloto %s ti ponudi da go kupis negovoto vozilo za $%d (Napisete /accept ownablecar) za da go kupite.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "   Igracot ne e vo vasa blizina ! ");
        return 1;
    }
}
}
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "  Ti ne si vo tvoeto vozilo");
        return 1;
    }
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Ti moras da sedis vo voziloto ako sakas da go prodades");
    return 1;
}
        }

Citat: Pavlesky poslato Septembar 05, 2012, 18:06:28 POSLE PODNE
Ali ako znas izmeni ja ti imam preko /v
if(strcmp(cmd, "/v", true) == 0) // By LordMan
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Ti mora da se logiras prvo ! ");
            return 1;
        }
        new x_nr[64];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
SendClientMessage(playerid, COLOR_WHITE, "SOVET: (/v)ehicle [ime]");
            SendClientMessage(playerid, COLOR_WHITE, "Dostapni iminja: lock, sell, sellto, color, paintjob, setcode, find.");
SendClientMessage(playerid, COLOR_WHITE, "Napisete {157DEC}/vozilo {FFFFFF}i na {FF0000}ednostaven {FFFFFF}nacin upravuvajte so vaseto vozilo.");
            return 1;
        }
        if(strcmp(x_nr,"sell",true) == 0)
        {
            if(IsAtDealership(playerid))
            {
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
                {
                    new ownvehkey;
                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
                    else { return 1; }
                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                    {
                        new carsellprice = GetVehiclePrice(ownvehkey) / 4 * 4;
                        SafeGivePlayerMoney(playerid,carsellprice);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "~w~Go prodadovte vasiot avtomobil za: ~n~~g~$%d", carsellprice);
                        GameTextForPlayer(playerid, string, 10000, 3);

                        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
PlayerInfo[playerid][pPcarkey] = 9999;
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
PlayerInfo[playerid][pPcarkey2] = 9999;
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
PlayerInfo[playerid][pPcarkey3] = 9999;
SafeRemovePlayerFromVehicle(playerid);
CarInfo[ownvehkey][cOwned] = 0;
CarInfo[ownvehkey][cOwner] = Drzava;
CarInfo[ownvehkey][cLocationx] = 1590.3740;
CarInfo[ownvehkey][cLocationy] = -1026.0565;
CarInfo[ownvehkey][cLocationz] = 23.9063;
CarInfo[ownvehkey][cAngle] = 317.1649;
CarInfo[ownvehkey][cReg] = 0;
DestroyVehicle(ownvehkey);
                        TogglePlayerControllable(playerid, 1);
OnPropUpdate(4,ownvehkey);
                        OnPlayerUpdateEx(playerid);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Morate da sedite vo vaseto vozilo za da go prodadete! ");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Ne ste vo prodavnicata za avtomobili!");
                return 1;
            }
        }
        else if(strcmp(x_nr,"sellto",true) == 0)
        {
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
    new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [price]");
    return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
    if(ProxDetectorS(8.0, playerid, giveplayerid))
        {
    if(PlayerInfo[giveplayerid][pPcarkey] == 9999)
    {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [price]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1500000)
            {
                SendClientMessage(playerid, COLOR_GREY, "  Parite ne smeeat da bida pomalku od 1 nitu pogolemi od 1500000. ");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "* Ti mu ponudi na %s da go kupi tvoeto vozilo za $%d .", giveplayer, price);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* Gazdata na voziloto %s ti ponudi da go kupis negovoto vozilo za $%d (Napisete /accept ownablecar) za da go kupite.", playername, price);
        SendClientMessage(giveplayerid, COLOR_WHITE, string);
        OwnableCarOffer[giveplayerid] = playerid;
        OwnableCarID[giveplayerid] = ownvehkey;
        OwnableCarPrice[giveplayerid] = price;
        return 1;
        }
else if(PlayerInfo[giveplayerid][pPcarkey2] == 9999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "SOVET: /v sellto [playerID/DeoImena] [pari]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, "  Parite ne smeeat da bida pomalku od 1 nitu pogolemi od 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Ti mu ponudi na %s da go kupi tvoeto vozilo za $%d.", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Gazdata na voziloto %s ti ponudi da go kupis negovoto vozilo za $%d (Napisete /accept ownablecar) za da go kupite.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "   Igracot ne e vo vasa blizina ! ");
        return 1;
    }
}
}
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "  Ti ne si vo tvoeto vozilo");
        return 1;
    }
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Ti moras da sedis vo voziloto ako sakas da go prodades");
    return 1;
}
        }



Hahaha ma lik je dao svoje i oce da mu se stavi u ZCMD i SSCANF sta stavljas to sranje?

hahaha imal ko da zna to da prevede mene samo zeza to params ud a mozda bi ostalo znao prevest


ma ocu da prebacim ovu komandu iz tog CMD u ono IF(....
ali neznam ko zna da mi pomogne

Ja vas ne kapiram prebacujete ZCMD,SSCANF komande u strcmp strtok i ta govna.Onda ti ne mogu pomoci ja znam iz govana u ovo ali iz ovog u govna ne znam stvarno