Szerző Téma: NPC Csatlakoztatása Timerel  (Megtekintve 494 alkalommal)

Nem elérhető [sdc]skyline

  • 1333
  • ςκyΙιηε
    • Profil megtekintése
NPC Csatlakoztatása Timerel
« Dátum: 2011. december 22. - 17:11:03 »
0 Show voters
Sziasztok
csináltam 2 npc -t
amit egy pwn bõl szeretnék csatlakoztatni timerrel ami nem nagyon mûködik.
A Drifter_NPC1 le spawnol bele rakja a kocsiba és megy, a Drifter_NPC2 le spawnol és ál a spawn helyen semmit nem csinál.
így néz ki:
[pawn]#include <a_samp>
new npcveh;
new npcveh2;
new timer;
forward NPCCsatlakozas( playerid );
public OnFilterScriptInit ( )
{
//Drifter_NPC
     ConnectNPC(\"Drifter_NPC\", \"load\");
     npcveh = CreateVehicle ( 562, 0.0, 0.0, 5.0, 0.0, 0, 0, -1 );
//Drifter_NPC2
ConnectNPC(\"Drifter_NPC2\", \"load2\");
     npcveh2 = CreateVehicle ( 562, 0.0, 0.0, 5.0, 0.0, 0, 0, -1 );
     return 1;
}
public OnPlayerSpawn ( playerid )
{
if ( IsPlayerNPC ( playerid ) )
     {
         //Drifter_NPC
        new npcname [ MAX_PLAYER_NAME ];
         GetPlayerName ( playerid, npcname, sizeof ( npcname ) );
       if ( !strcmp ( npcname, \"Drifter_NPC\", true ) )
       {
      PutPlayerInVehicle ( playerid, npcveh, 0 );
      SetPlayerColor(playerid, 0x00000000);
   }
   timer = SetTimer(\"NPCCsatlakozas\", 2000, false);
   return 1;
     }
     return 1;
}
public NPCCsatlakozas( playerid )
{
if ( IsPlayerNPC ( playerid ) )
     {
   //Drifter_NPC2
   new npcname2 [ MAX_PLAYER_NAME ];
         GetPlayerName ( playerid, npcname2, sizeof ( npcname2 ) );
       if ( !strcmp ( npcname2, \"Drifter_NPC2\", true ) )
       {
      PutPlayerInVehicle ( playerid, npcveh2, 0 );
      SetPlayerColor(playerid, 0x00000000);
   }
   return 1;
}
KillTimer(timer);
return 1;
}[/pawn]
Ha nem használok timert akkor jó mind a kettõ csatlakozik és bele dobja a jármûbe és mennek!
elõre is köszönöm a segítséget!
« Utoljára szerkesztve: 2011. december 22. - 17:12:35 írta driftBANDITS]skyline »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal