[POMOC]COS

Započeo Matrix_Green, Novembar 21, 2012, 17:20:27 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta:Moja od 0
Problem:Dodao sam neki cos sta sam nasao na kompu....I imam problem....Imam komande /kupiauto,/napraviauto,/prodajauto,/unistiauto
E sada mene zanima kako da postavim dok napravim auto da ga se nemoze voziti odma,tek dok ga kupim.....I problem mogu auto kupiti kolko god ocu puta kako da to popravim...I da napravim da mi sprema aute :D
Molim za pomoc
Dio skripte:

/kupiauto
CMD:kupiauto(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new i=Sacuvaniid(GetPlayerVehicleID(playerid));
if(i==999)return SCM(playerid,Bela,"Niste u vozilu za prodaju!");
if(GetPlayerMoney(playerid)<CarInfo[i][cValue])return SCM(playerid,Bela,"Nemate dovoljno novca da kupite ovaj auto!");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
strmid(CarInfo[i][cOwner],name, 0, strlen(name), 255);
CarInfo[i][cOwned] = 3;
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
SacuvajKola(GetPlayerVehicleID(playerid));
DestroyDynamic3DTextLabel(vozilanap[i]);
SCM(playerid,Bela,"Cestitamo kupili ste auto koristite /v za pomoc!");
}else return SCM(playerid,Bela,"Niste u vozilu za prodaju!");
return 1;
}


/napraviauto
CMD:napraviauto(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new veh,color1,color2,value;
if (!sscanf(params, "iiii", veh, color1,color2,value))
{
new Float:x, Float:y, Float:z,Float:Angles;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, Angles);

new lolcina = 1;
for(new i= 1; i< 999; i++)
{
new stringers[600];
format(stringers, sizeof(stringers), "sistemi/kola/Auto_%d.ini",i);
if(lolcina == 0){return 1;}
if(!fexist(stringers))
{
lolcina = 0;
CarInfo[i][cModel] = veh;
strmid(CarInfo[i][cOwner],"Dealership", 0, strlen("Dealership"), 255);
CarInfo[i][cOwned] = 2;
CarInfo[i][cValue] = value;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = x;
CarInfo[i][cLocationy] = y;
CarInfo[i][cLocationz] = z;
CarInfo[i][cAngle] = Angles;
CarInfo[i][cColorOne] = color1;
CarInfo[i][cColorTwo] = color2;
dini_Create(stringers);
CarInfo[i][cSpawned] = AddStaticVehicle(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz],CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo]);
SacuvajKola(CarInfo[i][cSpawned]);
new result[500];
format(result, sizeof(result),"{B39E4D}Vozilo na Prodaju!\n {B39E4D}Model:{ffffff} %s \n {B39E4D}Cena:{ffffff} $%d \n {B39E4D}Da kupis koristi {ffffff}/kupiauto {B39E4D}!",GetVehicleName(CarInfo[i][cSpawned]),CarInfo[i][cValue]);
vozilanap[i] = CreateDynamic3DTextLabel(result,0x8361FFFF,CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz],15, INVALID_PLAYER_ID,CarInfo[i][cSpawned], 0);
i=998;
SCM(playerid,Bela,"Napravili ste auto!");
}
}
}
else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[CMD]:{80FF00} /napraviauto[carid] [Color 1] [Color 2] [Cena]");
}
else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}ERROR: {AE9B51}Niste ovlasteni.");
return 1;
}

/unistiauto
CMD:unistiauto(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new i=Sacuvaniid(GetPlayerVehicleID(playerid));
if(i==999)return SCM(playerid,Bela,"Niste u vozilu za prodaju!");
CarInfo[i][cModel] = 0;
strmid(CarInfo[i][cOwner],"", 0, strlen(""), 255);
CarInfo[i][cOwned] = 0;
CarInfo[i][cValue] = 0;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = 0;
CarInfo[i][cLocationy] = 0;
CarInfo[i][cLocationz] = 0;
CarInfo[i][cAngle] = 0;
CarInfo[i][cColorOne] = 0;
CarInfo[i][cColorTwo] = 0;
CarInfo[i][cSpawned]=0;
new stringers[600];
format(stringers, sizeof(stringers), "sistemi/kola/Auto_%d.ini",i);
dini_Remove(stringers);
DestroyDynamic3DTextLabel(vozilanap[i]);
DestroyVehicle(GetPlayerVehicleID(playerid));
SCM(playerid,Bela,"Unistili ste auto!");
}else return SCM(playerid,Bela,"Niste u vozilu za prodaju!");
}
else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}ERROR: {AE9B51}Niste ovlasteni.");
return 1;
}

/prodajauto
CMD:prodajauto(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new i=Sacuvaniid(GetPlayerVehicleID(playerid));
if(i==999)return SCM(playerid,Bela,"Morate biti u vasem vozilu!");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(CarInfo[i][cOwned] == 3 && strcmp(name,CarInfo[i][cOwner], true) == 0)
{
if(IsAtDealership(playerid))
{
new Float:x, Float:y, Float:z,Float:Angles;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, Angles);
strmid(CarInfo[i][cOwner],"Dealership", 0, strlen("Dealership"), 255);
CarInfo[i][cOwned] = 2;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = x;
CarInfo[i][cLocationy] = y;
CarInfo[i][cLocationz] = z;
CarInfo[i][cAngle] = Angles;
GivePlayerMoney(playerid,CarInfo[i][cValue]);
SacuvajKola(GetPlayerVehicleID(playerid));
new result[500];
format(result, sizeof(result),"{B39E4D}Vozilo na Prodaju!\n {B39E4D}Model:{ffffff} %s \n {B39E4D}Cena:{ffffff} $%d \n {B39E4D}Da kupis koristi {ffffff}/kupiauto {B39E4D}!",GetVehicleName(GetPlayerVehicleID(playerid)),CarInfo[i][cValue]);
vozilanap[i] = CreateDynamic3DTextLabel(result,0x8361FFFF,CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz],15, INVALID_PLAYER_ID,GetPlayerVehicleID(playerid), 0);
SCM(playerid,Bela,"Cestitamo prodali ste vas auto!");
RemovePlayerFromVehicle(playerid);
}else return SCM(playerid,Bela,"Niste u prodavnici automobila!");
}else return SCM(playerid,Bela,"Morate biti u vasem vozilu!");
}else return SCM(playerid,Bela,"Morate biti u vasem vozilu!");
return 1;
}
<a href="http://tinypic.com?ref=5l2yrb" target="_blank"><img src="http://i47.tinypic.com/5l2yrb.png" border="0" alt="Image and video hosting by TinyPic"></a>