SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Español/Spanish

Reply
 
Thread Tools Display Modes
Old 11/03/2012, 10:54 PM   #1
xSeveNx
Big Clucker
 
Join Date: Jan 2012
Posts: 74
Reputation: 0
Default [DUDA]: Agregar Keys Para Que Se Active/Desactive Este FS

Bueno estuve rato intentando hacer que esto

pawn Code:
#define PRESSED(%0) \
   (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

new countpos[MAX_PLAYERS];
new Flame[MAX_PLAYERS][2];

forward Counter();

public OnFilterScriptInit()
{
    SetTimer("Counter",10000,1);
   return 1;
}

public OnPlayerConnect(playerid)
{
    countpos[playerid] = 0;
    return 1;
}

public Counter()
{
   for(new i; i < GetMaxPlayers(); i++)
   {
      if(IsPlayerConnected(i) && countpos[i] != 0)
      {
         countpos[i]++;
         if(countpos[i] == 4)
         {
            countpos[i] = 0;
            DestroyObject(Flame[i][0]);
            DestroyObject(Flame[i][1]);
         }
      }
   }
   return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if (PRESSED(KEY_FIRE))
   {
      new vehid = GetPlayerVehicleID(playerid);
      new model = GetVehicleModel(vehid);
      if(model == 522 || model == 461 || model == 463 || model == 468 || model == 523 || model == 403 || model == 472 || model == 478 || model == 411)
      {
         new Float:Velocity[3];
         GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]);
         if(Velocity[0] <1.0  && Velocity[1] < 1.2 && Velocity[0] > -1.3 && Velocity[1] > -1.3)
         {
            SetVehicleVelocity(vehid, Velocity[0]*2, Velocity[1]*2, 0.0);
            if(countpos[playerid] == 0)
            {
               countpos[playerid] = 1;
               if(model != 468)
               {
                  Flame[playerid][0] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
                  Flame[playerid][1] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
                  if(model == 522)
                  {
                     AttachObjectToVehicle(Flame[playerid][0], vehid, 0.194999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000);
                     AttachObjectToVehicle(Flame[playerid][1], vehid, -0.204999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000);
                  }
                  else if(model == 461)
                  {
                     AttachObjectToVehicle(Flame[playerid][0], vehid, -0.354999, 0.374999, -0.164999, 84.419967, 3.645001, 0.000000);
                     AttachObjectToVehicle(Flame[playerid][1], vehid, 0.135000, 0.374999, -0.164999, 84.419967, 3.645001, 0.000000);
                  }
                  else if(model == 463)
                  {
                     AttachObjectToVehicle(Flame[playerid][0], vehid, 0.164999, 0.909999, -0.379999, 86.429962, 3.645001, 0.000000);
                     AttachObjectToVehicle(Flame[playerid][1], vehid, -0.419999, 0.909999, -0.379999, 86.429962, 3.645001, 0.000000);
                  }
                  else if(model == 523)
                  {
                     AttachObjectToVehicle(Flame[playerid][0], vehid, -0.345999, 0.459999, -0.141999, 89.444953, 3.645001, 0.000000);
                     AttachObjectToVehicle(Flame[playerid][1], vehid, 0.119000, 0.459999, -0.141999, 89.444953, 3.645001, 0.000000);
                  }
               }
               else
               {
                  Flame[playerid][0] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
                  AttachObjectToVehicle(Flame[playerid][0], vehid, -0.095999, 0.734999, 0.159999, 90.449951, 3.645001, 0.000000);
               }
            }
         }
      }
   }
}

public OnPlayerDisconnect(playerid, reason)
{
   if(countpos[playerid] != 0)
   {
      countpos[playerid] = 0;
      DestroyObject(Flame[playerid][0]);
      DestroyObject(Flame[playerid][1]);
   }
   return 1;
}


Se active con Shift izquierdo y que se desactive presionando lo nuevamente,
pero no pude :c, así que quería saber si alguien me ayuda ;3

Gracias.
xSeveNx is offline   Reply With Quote
Old 11/03/2012, 11:44 PM   #2
The_M
Huge Clucker
 
The_M's Avatar
 
Join Date: Oct 2010
Location: Coquimbo, Chile
Posts: 309
Reputation: 3
Default Re: [DUDA]: Agregar Keys Para Que Se Active/Desactive Este FS

pawn Code:
(PRESSED(KEY_FIRE))

Disparo?
__________________
meh.
The_M is offline   Reply With Quote
Old 12/03/2012, 12:49 AM   #3
xSeveNx
Big Clucker
 
Join Date: Jan 2012
Posts: 74
Reputation: 0
Default Respuesta: [DUDA]: Agregar Keys Para Que Se Active/Desactive Este FS

Pero con ese hace que se pueda usar, yo quiero que al apretar Shift, se active el FS y obviamente presionando clic se use asdf

O sea de que se puede usar eso, se puede, pero quiero que se active y desactive ;G ya que es un poco molesto aveces
xSeveNx is offline   Reply With Quote
Old 12/03/2012, 03:19 PM   #4
Kurama
Big Clucker
 
Kurama's Avatar
 
Join Date: Feb 2012
Posts: 150
Reputation: 6
Default Respuesta: [DUDA]: Agregar Keys Para Que Se Active/Desactive Este FS

pawn Code:
if(PRESSED(KEY_JUMP))
__________________
My Nick In-game/Mi nick en el juego: Sharingan...
We HATE the audio stream message!
Together we are strong.
Together we can change Kalcor's mind.
Copy & paste if you agree!
Kurama is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Duda] Como agregar.... joel_ray Español/Spanish 5 03/09/2011 05:01 PM
[DUDA-HOST] Agregar INCLUDES GoldenDragon Español/Spanish 5 23/08/2011 10:30 PM
[duda]Como Agregar Carros a Un RP kaltox Español/Spanish 13 20/06/2011 12:03 AM
Duda sobre agregar auto aagu Español/Spanish 4 04/02/2011 01:05 AM
[Duda] Comando que desactive algo. Komputilo Español/Spanish 3 29/12/2010 09:31 PM


All times are GMT. The time now is 06:44 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.