[DUV] NPC's
#1

Olб, fiz alguns NPC's para os player's dar umas voltinhas pelo mapa.. testei no GRANDLARC e tudo funcionou perfeitamente, quando fui implantar em outro GM,
para ver se iria funcionar, surgiu um seguinte "conflito", ao invйz do NPC comeзar no Ciclo 1, fazer todo percurso e apуs terminar comeзar o ciclo 2...
Ele comeзa o ciclo 1, em questгo de segundos ele termina(ninja) entгo comeзa no ciclo 2... e assim da algumas vezes e para.

Repetindo, no GRANDLARC nгo aconteceu isso, jб nesse GM estб acontecendo.

Em OnPlayerSpawn botei

pawn Code:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
e em OnPlayerRequestClass:
pawn Code:
if(IsPlayerNPC(playerid))
{
SpawnPlayer(playerid);
return 1;
}
gm й 'gtarp' ;x

@EDIT, algumas SS's

/imageshack/gal.php?g=samp025j.png
Reply
#2

desculpa, NPC й coisa k nunca tentei fazer....


-EDIT-


mas para ajudar e poupar o trabalho de quem percebe, aconselho-te a postar o codigo do NPC tb
Reply
#3

Aqui o FS

pawn Code:
/*==============================================================================
--------------------------------------------------------------------------------

                            NeoN' NPC's
                   bY sToner

--------------------------------------------------------------------------------
==============================================================================*/

#include <a_samp>
#define COR_BRANCO 0xFFFFFFAA
new Taxi1;
new Coach1,Coach2;
new Aviao1,Aviao2;
new bus1,bus2;

public OnGameModeInit()
{
    ConnectNPC("Taxista_1","taxi_ls");
    ConnectNPC("Motorista_1","coach_LS_SF");
    ConnectNPC("Motorista_2","coach_SF_LS");
  ConnectNPC("Motorista_LS","busao_LS");
    ConnectNPC("Piloto_LS","aviao_LS_SFx");
    ConnectNPC("Piloto_SF","aviao_SF_LSx");
  ConnectNPC("Motorista_SF","busao_SFx");


    Taxi1 = AddStaticVehicle(438,1488.3854,1435.1993,10.8203,0.000,-1,-1);
    Coach1 = AddStaticVehicle(437,1488.3854,1435.1993,10.8203,0.000,3,3);
    Coach2 = AddStaticVehicle(437,1488.3854,1435.1993,10.8203,0.000,3,3);
    Aviao1 = AddStaticVehicle(577,1488.3854,1435.1993,10.8203,0.000,1,3);
    Aviao2 = AddStaticVehicle(577,1488.3854,1435.1993,10.8203,0.000,1,3);
    bus1 = AddStaticVehicle(431,1488.3854,1435.1993,10.8203,0.000,0,0);
    bus2 = AddStaticVehicle(431,1488.3854,1435.1993,10.8203,0.000,0,0);

    return 1;
}

public OnPlayerSpawn(playerid)
{
  if(!IsPlayerNPC(playerid)) return 0;

    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"Taxista_1",true)) {
    PutPlayerInVehicle(playerid, Taxi1, 0);
    SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
    new Text3D:Taxi1 = Create3DTextLabel("Taxista_1",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Taxi1, playerid, 0.0, 0.0, 0.5);
    }
    else if(!strcmp(playername,"Motorista_1",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, Coach1, 0);
      new Text3D:coach_LS_SF = Create3DTextLabel("Motorista_1",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(coach_LS_SF, playerid, 0.0, 0.0, 0.5);
        }
  else if(!strcmp(playername,"Piloto_LS",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, Aviao1, 0);
        new Text3D:PTD1 = Create3DTextLabel("Aviao_de_LS",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(PTD1, playerid, 0.0, 0.0, 0.5);
    }
    else if(!strcmp(playername,"Piloto_SF",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, Aviao2, 0);
        new Text3D:PTD2 = Create3DTextLabel("Aviao_de_SF",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(PTD2, playerid, 0.0, 0.0, 0.5);
    }
  else if(!strcmp(playername,"Motorista_2",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, Coach2, 0);
      new Text3D:coach_SF_LS = Create3DTextLabel("Chuck_Norris",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(coach_SF_LS, playerid, 0.0, 0.0, 0.5);
    }
    else if(!strcmp(playername,"motorista_LS",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, bus1, 0);
      new Text3D:busao_LS = Create3DTextLabel("Motorista_LS",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(busao_LS, playerid, 0.0, 0.0, 0.5);
    }
    else if(!strcmp(playername,"motorista_SF",true)) {
      SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        PutPlayerInVehicle(playerid, bus2, 0);
      new Text3D:Stunter = Create3DTextLabel("Motorista_SF",COR_BRANCO,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Stunter, playerid, 0.0, 0.0, 0.5);
    }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)