[Pomoc] /veh komanda

Započeo MEMOREX™️, Decembar 05, 2012, 22:49:33 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Mod: nl
Problem: Znaci komanda ide /vehicle [create/destroy] , e kad kucam /vehicle create treba da mi izbaci /vehicle create /vehicle create [id/ime] [boja1] [boja2] e to mi i izbaci ali kad idem /vehicle create 411 0 0 nece da mi spawna vozilo, mislim da nisam dobro uklopio komandu, ako moze pomoc da mi neko fixa komandu da mi spawna vozilo, /vehicle destroy radi ;)
Kod:

CMD:vehicle(playerid, params[])
{
if(PI[playerid][Admin] >= 1 || IsPlayerAdmin(playerid))
{
    new akcija[32];
    //new string[500];
    if(sscanf(params, "s[32]", akcija))
    {
        SCM(playerid, COLOR_DGOLD, "Koristite: /vehicle [create/destroy]");
        return 1;
}
if(!strcmp(akcija, "create", true))
{
new veh[24], color1, color2;
         if(sscanf(params, "s[32]s[24]I(-1)I(-1)",akcija, veh, color1, color2)) return SCM(playerid, COLOR_DGOLD, "Koristite: /vehicle create [id/ime] [boja1] [boja2]");
         if(PI[playerid][Admin] >= 1)
         {
     new VehicleNames[212][] = {
{"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
{"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
{"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
{"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
{"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
{"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
{"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
{"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
{"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
{"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
{"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
{"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
{"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
{"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
{"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
{"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
}, vehicle = -1;

for(new v; v < 212; v++) if(strfind(VehicleNames[v], veh, true) != -1) { vehicle = v + 400; break; }
if(vehicle == -1) vehicle = strval(veh);
if(vehicle < 400 || vehicle > 611) return SCM(playerid, COLOR_RED, "ERROR: | {FFFFFF}Upisite postojece ime, ili ID Vozila (400-611)!");
new vCar = GetPlayerVehicleID(playerid);
new Float:Pos[4];
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
}
else
{
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
}
/*if(vCar[playerid] == -1)
{
DestroyVehicle(vCar[playerid]);
vCar[playerid] = 0;
}*/
new string[1500];
vCar = CreateVehicle(vehicle, Pos[0], Pos[1], Pos[2]+2, Pos[3], color1,color2, -1);
if(VoziloJeAvion(GetVehicleModel(vCar)) || VoziloJeBrod(GetVehicleModel(vCar)) || VoziloJeKamion(GetVehicleModel(vCar))) Gorivo[vCar] = 100.00;//
else if(VoziloJeMotor(GetVehicleModel(vCar))) Gorivo[vCar] = 20.00;
else Gorivo[vCar] = 55.00;
new engine, lights, alarm, doors, bonnet, boot, objective;
SetVehicleNumberPlate(vCar, "EAGLE$$");
GetVehicleParamsEx(vCar, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vCar, 1, 1, alarm, doors, bonnet, boot, objective);
PutPlayerInVehicle_H(playerid, vCar, 0);
new kkk[MAX_PLAYER_NAME];
    RPIme(playerid, kkk);
//GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{F81414}INFO: {FFFFFF}Vozilo {F81414}%s {FFFFFF}je stvoreno.",VehicleNames[vehicle -400]);
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string), "{808080}((ADMIN)){FFFFFF} %s je uspjesno stvorio vozilo. [%s]", kkk, VehicleNames[vehicle -400]);
AdminPoruka(WHITE, string);
return 1;
}
}
//DESTOTY
if(!strcmp(akcija, "destroy", true))
{
if(PI[playerid][Admin] >= 1337)
         {
         DestroyVehicle(GetPlayerVehicleID(playerid));
         new string[500];
         new kkk[MAX_PLAYER_NAME];
         RPIme(playerid, kkk);
         SendClientMessage(playerid,COLOR_RED,"INFO: {FFFFFF}Unistili ste vozilo.");
         format(string, sizeof(string), "{808080}((ADMIN)) {FFFFFF}%s je unistio vozilo.", kkk);
         AdminPoruka(COLOR_RED,string);
         return 1;
         }
         else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste autorizirani da koristite ovu komandu - nemate administrator level.");
}
return 1;
}
}
return 1;
}
Skriptam za pare

Zoran123


CMD:vehicle(playerid, params[])
{
if( isnull( params ) ) return SendClientMessage(playerid, NARANDZASTA, "Koristite: /veh [ID Modela]");
if(!IsPlayerConnected(playerid)) return 0;
if(PI[playerid][Admin] >= 5 || IsPlayerAdmin(playerid))
{
if(strval(params) < 400 || strval(params) > 611) return SCM(playerid, GRAD2, "    [{F81414}Greska!{FFFFFF}] ID Modela mora biti veci od 399 i manji od 612!");
new Float:Poz[4];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
GetPlayerFacingAngle(playerid, Poz[3]);
new v = CreateVehicle_H(strval(params), Poz[0]+4, Poz[1], Poz[2], Poz[3], 0, 0, 200);
format(CmdString, sizeof CmdString, "Vozilo stvoreno! [Vozilo ID: %d | Model vozila: %s]", v, ImenaVozila[strval(params) - 400]);
SCM(playerid, ZELENA2, CmdString);
if(VoziloJeAvion(GetVehicleModel(v)) || VoziloJeBrod(GetVehicleModel(v)) || VoziloJeKamion(GetVehicleModel(v))) Gorivo[v] = 100.00;
    else if(VoziloJeMotor(GetVehicleModel(v))) Gorivo[v] = 15.00;
    else Gorivo[v] = 60.00;
    new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(v, 1, 1, alarm, doors, bonnet, boot, objective);
PutPlayerInVehicle_H(playerid, v, 0);
}
else return SCM(playerid, GRAD2, "    [{F81414}Greska!{FFFFFF}] Niste autorizovani da koristite ovu komandu!");
return 1;
}




ovo ti je najlakša komanda a ako ti neki error izbaci vjerovatno ti nije definirana boja
Poslednja Izmena: Decembar 06, 2012, 13:19:49 POSLE PODNE od Zoran123

Zoran123

Citat: David (Sabljak) poslato Decembar 06, 2012, 13:23:17 POSLE PODNE
Neznam cemu tolke komplikacije sa tom komandom evo vrlo jednostavno bez previse [cenzura]osti u njoj -.-

CMD:veh(playerid, params[])
{
new vozilo,boja1,boja2;
if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid,COLOR_RED,"{B3B3B3}[{FF0000}Greska!{B3B3B3}] Niste Admin!");
else if(sscanf(params, "iii", vozilo, boja1,boja2)) return SCM(playerid, COLOR_ORANGE,"Koristi:{FFFFFF} /veh [ID Vozila] {00C43E}[Boja 1] [Boja 2]");
else if(vozilo < 400 || vozilo > 611) return SCM(playerid, COLOR_RED,"{B3B3B3}[{FF0000}Greska!{B3B3B3}] Krivi ID Vozila!");
else
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
AddStaticVehicle(vozilo,x,y,z,0,boja1,boja2);
SetVehicleNumberPlate(vozilo,"Admin Auto");
SCM(playerid, COLOR_RED,"{B3B3B3}[{FF0000}Vozilo!{B3B3B3}] Kreirali ste vozilo!");
}
return 1;
}
CMD:unistivozilo(playerid, cmdtext[])
{
if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid,COLOR_RED,"{B3B3B3}[{FF0000}Greska!{B3B3B3}] Niste Admin!");
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, 0xFFFFFFFF, "{FF0000}>> [GRESKA] {FFFFFF}Niste u vozilu!");
DestroyVehicle(GetPlayerVehicleID(playerid));
SCM(playerid,COLOR_RED,"{B3B3B3}[{FF0000}Vozilo!{B3B3B3}] Unistili ste vozilo!");
return 1;
}




sabljak lakše mu je ovo moje

ae uradio sam :P Moze LOCK! :D
Skriptam za pare