Jump to content
  • 0

[NEW]Tractare Vehicule (masini)[NEW]


Question

Posted

Salut .

Stit cumva daca este vre-o metoda ( vreun cod, fs,etc) sa dau de ex :

/ad - si daca sunt in fata unei masini ,sa se prinda masina din spate de masina pe care o conduc si sa tractez masina din spatele meu unde vreau :D

Va rog,aveti?

ca cu masiniile alea de agatat din san andreas ,in sa:mp nu merg, va rog daca este vreun fs sa mil dati si mie  ;D

multumesc

qdbjz10.png

6 answers to this question

Recommended Posts

Posted

si  trebuie sa pun acest cod :

 AttachTrailerToVehicle(5, 1); 

si unde?

si cum va tracta? toate vehiculele?

mai multe detalii te rog

qdbjz10.png

Guest farse
Posted

if ( strcmp ( cmdtext , "/ad", true)==0){

new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if  ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFF00AA,"Ai deatasat masina");
}else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
new string[256];
format(string,256,"Acum tu tractezi un %s",VehicleName[GetVehicleModel(vid)-400]);
SendClientMessage(playerid,0xFFFF00AA,string);
}
}
}
if  (!Found)
{
SendClientMessage(playerid,0xFFFF00AA,"Nu am gasit nici un vehicul,mergeti mai aproape de masina.");
}
return 1;
}

simple,no?

Posted

Mersi Farse ,esti cel mai tare  ;):P

sa vad daca si merge :D

~EDIT~ :

 C:\Locker\sa-mp scripting\romania cool server\gamemodes\gmstunt.pwn(759) : error 017: undefined symbol "VehicleName"
C:\Locker\sa-mp scripting\romania cool server\gamemodes\gmstunt.pwn(759) : warning 215: expression has no effect
C:\Locker\sa-mp scripting\romania cool server\gamemodes\gmstunt.pwn(759) : error 001: expected token: ";", but found "]"
C:\Locker\sa-mp scripting\romania cool server\gamemodes\gmstunt.pwn(759) : error 029: invalid expression, assumed zero
C:\Locker\sa-mp scripting\romania cool server\gamemodes\gmstunt.pwn(759) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
si am pus codul doar la  :
[code] public OnPlayerCommandText(playerid, cmdtext[])
{
//tractare vehicule
if ( strcmp ( cmdtext , "/ad", true)==0){

new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if  ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFF00AA,"Ai deatasat masina");
}else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
new string[256];
format(string,256,"Acum tu tractezi un %s",VehicleName[GetVehicleModel(vid)-400]);
SendClientMessage(playerid,0xFFFF00AA,string);
}
}
}
if  (!Found)
{
SendClientMessage(playerid,0xFFFF00AA,"Nu am gasit nici un vehicul,mergeti mai aproape de masina.");
}
return 1;
}
///////

E BINE UNDE LAM PUS ? ADICA ONPLAYERCOMMANDTEXT? numai acolo trebuie????,eu am dat copy si paste in onPlayerCommandText ? acolo trb tot ?

qdbjz10.png

Guest farse
Posted

Pai nuj cum e denumita la tine variabila aia,sau daca o ai...

Uite cum faci:

Pe la inceput,pe la variabile:

new VehicleName[][] = {
   "Landstalker",  "Bravura",  "Buffalo", "Linerunner", "Perennial", "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",  "Previon", "Coach", "Cabbie",
   "Stallion", "Rumpo", "RC Bandit",  "Romero", "Packer", "Monster",  "Admiral",
   "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer",  "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", "Hotring Racer", "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", "Hustler", "Intruder", "Primo", "Cargobob",  "Tampa",
   "Sunrise", "Merit",  "Utility Truck", "Nevada", "Yosemite", "Windsor", "Monster",
   "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RCTiger",
   "Flash", "Tahoma", "Savanna", "Bandito", "Freight", "Trailer", "Kart", "Mower",
   "Dune", "Sweeper", "Broadway", "Tornado", "AT-400",  "DFT-30", 	  "Huntley",
   "Stafford", "BF-400", "Newsvan", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros",
   "Hotdog", "Club", "Trailer", "Trailer", "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", "Luggage Trailer", "Stair Trailer", "Boxville", "Farm Plow",
   "Utility Trailer"
};

Si comanda o lesi unde e ea

Posted

A mers ,Farse, Multumesc mult ::)

 Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase 

Puteti ichide topicul , multumesc !

qdbjz10.png

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.