#include <a_samp>#include <zcmd> CMD:tow(playerid,params[]){/* Ide tegyél lekérdezést, hogy õ vontathat e stb.. */ return SendClientMessage(playerid, -1, \"Te nem vontathatsz!\"); 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)); } AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); SendClientMessage(playerid, -1,\"Vontatókötél felakasztva\"); } } if (!Found) { SendClientMessage(playerid,-1,\"Nincs kocsi a közelben!\"); } return 1;}
#include <a_samp>#include <zcmd>#pragma tabsize 0 CMD:tow(playerid,params[]){ /* Ide tegyél lekérdezést, hogy õ vontathat e stb.. */ return SendClientMessage(playerid, -1, \"Te nem vontathatsz!\"); 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)); } AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); SendClientMessage(playerid, -1,\"Vontatókötél felakasztva\"); } } if (!Found) { SendClientMessage(playerid,-1,\"Nincs kocsi a közelben!\"); } return 1;}