CMD:veh(playerid, params[]){if(PlayerInfo[playerid][pAdmin] >= 1){ new veh,color1,color2; if (!sscanf(params, \"iii\", veh, color1,color2)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x,y,z); AddStaticVehicle(veh, x,y,z,0,color1, color2); } else SendClientMessage(playerid, COLOR_WHITE, \"Usage: /veh [carid] [Color 1] [Color 2]\");}else SendClientMessage(playerid, GREY, NOADMIN);return 1;}
new VehNames[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\"},{\"shitGlendale\"},{\"shitSadler\"},{\"Luggage Trailer A\"},{\"Luggage Trailer B\"},{\"Stair Trailer\"},{\"Boxville\"},{\"Farm Plow\"},{\"Utility Trailer\"}};
print(\"Loaded Vehicles\");
CMD:veh(playerid, params[]) {new vehid;if(sscanf(params, \"i\", vehid)) SendClientMessage(playerid, -1, \"HASZNÁLAT: /veh <kocsi ID>\"); if (vehid < 400 || vehid > 611) SendClientMessage(playerid, -1, \"Rossz kocsi szám!\");{new Float:x, Float:y, Float:z;GetPlayerPos(playerid, x, y, z);CreateVehicle(vehid, x + 3, y, z, 0, 0,0, -1);SendClientMessage(playerid, -1, \"Jármû lekérve síkeresen!\");}return 1;}
CMD:veh(playerid, params[]){ new veh,color1,color2;if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, GREY, NOADMIN);if (sscanf(params, \"iii\", veh, color1,color2)) return SendClientMessage(playerid, COLOR_WHITE, \"Usage: /veh [carid] [Color 1] [Color 2]\");new Float:x, Float:y, Float:z;GetPlayerPos(playerid, x,y,z); CreateVehicle(veh, x,y,z,0,color1, color2, -1);return 1;}
hagyátok már a sok hülyeséggel szerencsétlent mert még 6 évig is ezen fog agyalniAzért írja neked mindig ki akár mit is írsz be mert az sscanfod régi verzió...az új sscanf inc és sscanf plugins kell nekedsscanf 2.6
Érdekes csak nekem ne jó ez a sz@r? Beírom pl. /veh 650 1 1 Erre kiírja: Usage: /veh [carid] Nem értem már ezt... az a baj ha egy meglévõ módból szedek ki az is ugyan úgy sz@rt nem ér... [/quote]400tól 611ig vannak a jármû IDk.nekem mûködött.
#include <a_samp>#define white 0xFFFFFFFFpublic OnPlayerCommandText(playerid, cmdtext[]){new cmd[256], idx;cmd = strtok(cmdtext, idx);if(strcmp(cmd, \"/v\", true) == 0){if(IsPlayerAdmin(playerid) == 0) return 0;new var1;new tmp1[256];tmp1 = strtok(cmdtext, idx);if(!strlen(tmp1)) return SendClientMessage(playerid, white, \"USE: /v [id]\");var1 = strval(tmp1);if(var1 < 400 || var1 > 611){ return SendClientMessage(playerid, white, \"USE: Car IDs go from 400 to 611\");}new Float:x, Float:y, Float:z, Float:a;GetPlayerFacingAngle(playerid, a);GetPlayerPos(playerid, x, y, z);if(IsPlayerInAnyVehicle(playerid) == 1){ GetXYInFrontOfPlayer(playerid, x, y, ;}else{ GetXYInFrontOfPlayer(playerid, x, y, 5);}new i = GetPlayerInterior(playerid);new v = CreateVehicle(var1, x, y, z, a+90, -1, -1, 0);LinkVehicleToInterior(v, i);new string[100];format(string, sizeof(string), \"Car with id %d has been spawned\", var1);SendClientMessage(playerid, white, string);new pname[26];GetPlayerName(playerid, pname, sizeof(pname));printf(\"RCON (In-Game): [%s] sent command: v %d\", pname, var1); return 1;}return 0;}stock strtok(const string[], &index){new length = strlen(string);while ((index < length) && (string[index] <= \' \')){index++;}new offset = index;new result[20];while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1))){result[index - offset] = string[index];index++;}result[index - offset] = EOS;return result;}stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance){new Float:a;GetPlayerPos(playerid, x, y, a);GetPlayerFacingAngle(playerid, a);if(GetPlayerVehicleID(playerid)){GetVehicleZAngle(GetPlayerVehicleID(playerid), a);}x += (distance * floatsin(-a, degrees));y += (distance * floatcos(-a, degrees));}