Moj auto

Započeo Fico_Milosevic, Januar 30, 2010, 15:22:27 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Jel mi može netko pomoći da napravim komandu za kupavanje i prodavanje auta? Hvala!Pokušavao sam napraviti prema larpu ali mi neće pokazat dok sjednem u taj auto za kupovanje nego ga mogu voziti.Evo vam kod pa recite di sam pogriješio i pomozite čim prije!Hvala!!
Ovo je kod di je prodavaonica:
//---------------------------------------------] PRODAVAONICA AUTI LS [-----------------------------------------------

    CreateStreamObject(982, 1059.2198486328, -1749.5587158203, 13.2805519104, 0.000000, 0.000000, 0.000000, 300.0);
    CreateStreamObject(982, 1059.2475585938, -1763.9635009766, 13.2805519104, 0.000000, 0.000000, 0.000000, 300.0);
    CreateStreamObject(982, 1071.9995117188, -1776.8117675781, 13.2805519104, 0.000000, 0.000000, 270.27026367188, 300.0);
    CreateStreamObject(982, 1089.6241455078, -1776.7474365234, 13.2805519104, 0.000000, 0.000000, 270.26916503906, 300.0);
    CreateStreamObject(982, 1072.0146484375, -1735.7749023438, 13.2805519104, 0.000000, 0.000000, 270.02026367188, 300.0);
    CreateStreamObject(982, 1089.6650390625, -1735.7750244141, 13.2805519104, 0.000000, 0.000000, 270.01647949219, 300.0);
    CreateStreamObject(982, 1102.3308105469, -1763.8408203125, 13.202023506165, 0.000000, 0.000000, 0.000000, 300.0);
    CreateStreamObject(3881, 1106.03125, -1738.6701660156, 14.322088241577, 0.000000, 0.000000, 89.904907226563, 300.0);
    CreateStreamObject(3881, 1104.4516601563, -1749.5819091797, 14.322088241577, 0.000000, 0.000000, 0.17111206054688, 300.0);


    AddStaticVehicle(405, 1062.9942626953, -1737.3273925781, 13.481558799744, 270.55017089844, 1, 1); //340
    AddStaticVehicle(409, 1081.0974121094, -1754.853515625, 13.322808265686, 270.27026367188, 1, 1); //341
    AddStaticVehicle(409, 1080.8953857422, -1758.0009765625, 13.322808265686, 270.26916503906, 1, 1); //342
    AddStaticVehicle(431, 1080.6557617188, -1771.2119140625, 13.614619255066, 270.26916503906, 1, 1); //343
    AddStaticVehicle(431, 1080.6669921875, -1775.2152099609, 13.614619255066, 270.26916503906, 1, 1); //344
    AddStaticVehicle(437, 1080.5355224609, -1766.6104736328, 13.619809150696, 270.27026367188, 1, 1); //345
    AddStaticVehicle(437, 1080.6633300781, -1762.3937988281, 13.619809150696, 270.26916503906, 1, 1); //346
    AddStaticVehicle(480, 1062.7364501953, -1740.2657470703, 13.318079948425, 270.27026367188, 1, 1); //347
    AddStaticVehicle(555, 1062.5272216797, -1743.3498535156, 13.243768692017, 270.27026367188, 1, 1); //348
    AddStaticVehicle(559, 1062.4777832031, -1746.2017822266, 13.204976081848, 270.27026367188, 1, 1); //349
    AddStaticVehicle(559, 1062.4733886719, -1749.0874023438, 13.204976081848, 270.26916503906, 1, 1); //350
    AddStaticVehicle(560, 1062.6281738281, -1752.0209960938, 13.244143486023, 268.240234375, 1, 1); //351
    AddStaticVehicle(560, 1062.7232666016, -1754.9301757813, 13.244143486023, 268.23669433594, 1, 1); //352
    AddStaticVehicle(587, 1062.8358154297, -1757.8171386719, 13.221707344055, 270.27026367188, 1, 1); //353
    AddStaticVehicle(603, 1062.6519775391, -1760.8267822266, 13.409393310547, 270.27026367188, 1, 1); //354
    AddStaticVehicle(411, 1062.5393066406, -1763.8862304688, 13.188635826111, 270.31530761719, 1, 1); //355
    AddStaticVehicle(415, 1062.4168701172, -1766.818359375, 13.229244232178, 270.27026367188, 1, 1); //356
    AddStaticVehicle(429, 1062.7088623047, -1769.7521972656, 13.117730140686, 270.27026367188, 1, 1); //357
    AddStaticVehicle(541, 1062.720703125, -1772.6431884766, 13.06069278717, 270.31518554688, 1, 1); //358
    AddStaticVehicle(558, 1062.875, -1775.4998779297, 13.054407119751, 270.27026367188, 1, 1); //359
    AddStaticVehicle(419, 1098.5872802734, -1754.9562988281, 13.288133621216, 90.714721679688, 1, 1); //360
    AddStaticVehicle(518, 1098.6440429688, -1757.8699951172, 13.151832580566, 90.8349609375, 1, 1); //361
    AddStaticVehicle(534, 1099.0295410156, -1760.9964599609, 13.173606872559, 89.729858398438, 1, 1); //362
    AddStaticVehicle(534, 1098.9825439453, -1763.845703125, 13.173606872559, 89.725341796875, 1, 1); //363
    AddStaticVehicle(535, 1098.3914794922, -1766.7520751953, 13.190603256226, 89.729858398438, 1, 1); //364
    AddStaticVehicle(536, 1098.2805175781, -1769.4542236328, 13.198537826538, 89.729858398438, 1, 1); //365
    AddStaticVehicle(575, 1098.3076171875, -1772.4921875, 13.086682319641, 89.729858398438, 1, 1); //366
    AddStaticVehicle(576, 1098.2030029297, -1775.6126708984, 13.094509124756, 89.729858398438, 1, 1); //367
    AddStaticVehicle(418, 1096.6740722656, -1738.7265625, 13.681882858276, 220.42041015625, 1, 1); //368
    AddStaticVehicle(440, 1092.3602294922, -1738.8477783203, 13.737000465393, 220.3603515625, 1, 1); //369
    AddStaticVehicle(482, 1088.1522216797, -1738.9943847656, 13.752217292786, 220.42041015625, 1, 1); //370
    AddStaticVehicle(483, 1083.962890625, -1739.3400878906, 13.598505973816, 220.42041015625, 1, 1); //371
    AddStaticVehicle(508, 1079.4421386719, -1739.9818115234, 13.964903831482, 220.42041015625, 1, 1); //372
    AddStaticVehicle(482, 1073.4417724609, -1739.2449951172, 13.730771064758, 220.37536621094, 1, 1); //373

Ovo je komanda
//---------------------------------------] MY CAR [---------------------------------------------------------
if(strcmp(cmd, "/buycar", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Prvo se moraÅ¡ logirati ! ");
            return 1;
        }
        if(IsAnOwnableCar(idcar))
        {
    if(PlayerInfo[playerid][pPcarkey] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey2] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey3] == 999) { }
    else { SendClientMessage(playerid, COLOR_GREY, "   Već posjedujete 3 vozila"); return 1; }
if(CarInfo[idcar][cOwned]==1)
{
    SendClientMessage(playerid, COLOR_GREY, "Netko je već vlasnik ovog vozila");
    return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
{
    if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; }
    else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }
    else if(PlayerInfo[playerid][pPcarkey3] == 999) { PlayerInfo[playerid][pPcarkey3] = idcar; }
    else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
PlayerPlayMusic(playerid);
GameTextForPlayer(playerid, "~w ÄŒestitamo ~n~ Nemojte ga zaboraviti parkirati(/park)!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "ÄŒestitamo na kupnji!");
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novaca ! ");
    return 1;
}
    }
    }
}

Tu je public od IsAnOwnableCar
public IsAnOwnableCar(carid)
{
if((carid > 343) && (carid < 370))
{
    if(carid == 45 || carid == 46 || carid == 55 || carid == 59) { return 0; }
return 1;
}
return 0;
}

I ovo sam stavio pod OnPlayerStateChange
new newcar = GetPlayerVehicleID(playerid);
if(IsAnOwnableCar(newcar))
{
if(CarInfo[newcar][cOwned]==0)
    {
        TogglePlayerControllable(playerid, 0);
        format(string,sizeof(string),"~w~Vozilo: %s~n~Cijena: ~g~%d~n~~w~/buycar da biste kupili ovo vozilo~n~~r~/exit ~w~da biste izaÅ¡li iz vozila",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
GameTextForPlayer(playerid,string,5000,5);
    }
    if(CarInfo[newcar][cOwned]==1)
    {
        format(string,sizeof(string),"Vozilo registrirano na %s",CarInfo[newcar][cOwner]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
/*if(keycar != vehicle)
{
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}*/
if(PlayerInfo[playerid][pPcarkey] == vehicleid) { }
else if(PlayerInfo[playerid][pPcarkey2] == vehicleid) { }
else if(PlayerInfo[playerid][pPcarkey3] == vehicleid) { }
else
{
    if(PlayerInfo[playerid][pAdmin] >= 1337 && OnDuty[playerid] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "  MožeÅ¡ voziti ovo vozilo jer si admin on duty !");
}
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GREY, "NemaÅ¡ ključ ovog vozila");
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}

Balkan Secret nije još jedan GF edit. Ovaj mod je pisan od nule.