grua auto
#3

Код:
if(strcmp(cmdtext, "/remolcar", true) == 0)
{
	    if(IsPlayerConnected(playerid))
	    {
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	                   if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
		     	   {
		     	   if(GetPlayerState(playerid) == 2)
		     	   {
			   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));
			   }
			   else
			   {
			   AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
			   }
			   }
			   }
			   if(!Found)
			   {
			   SendClientMessage(playerid,0xFFFF00AA,"No hay Ningun vehiculo cerca para remolcar.");
			   }
			   }
			   else
			   {
			   SendClientMessage(playerid, 0xFFFF00AA, "Tienes que ser el conductor para poder remolcar!");
			   return 1;
			   }
			   }
			   else
			   {
			   SendClientMessage(playerid, 0xFFFF00AA, "Nesesitas estar en una grua para remolcar!");
			   return 1;
			   }
			   }
			   else
			   {
			   SendClientMessage(playerid, 0xFFFF00AA, "No puedes remolcar a pie!");
			   return 1;
			   }
			   }
		           return 1;
}
Reply


Messages In This Thread
grua auto - by chucho - 26.03.2012, 17:44
Respuesta: grua auto - by [Nikk] - 26.03.2012, 18:48
Respuesta: grua auto - by TiNcH010 - 27.03.2012, 00:27
Respuesta: grua auto - by chucho - 27.03.2012, 16:22
Respuesta: grua auto - by TiNcH010 - 27.03.2012, 16:29
Respuesta: grua auto - by chucho - 27.03.2012, 16:43

Forum Jump:


Users browsing this thread: 1 Guest(s)