[pomoc]NPC

Započeo ‹Fox›, Januar 25, 2011, 18:23:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Radio sam NPC-a i kada upalim server npc se connecta ali za 5sec izadje iz servera
evo sta sam sve stavljao:
OnGameModeInit:
 MyFirstNPCVehicle = CreateVehicle(400, 728.1876,-1751.8760,14.5511, 0.0, 3, 3, 5000);
//Botine :D//
ConnectNPC("lowara","testbot");

OnPlayerConnect:
if(IsPlayerNPC(playerid))
{
}
else
{
gPlayerLogged[playerid] = 0;
   new name[MAX_PLAYER_NAME], file[256];
   GetPlayerName(playerid, name, sizeof(name));
   format(file, sizeof(file), SERVER_USER_FILE, name);
   TogglePlayerSpectating(playerid, 1);
   if (!dini_Exists(file))
   {
   new string[128],
   ime[24];
GetPlayerName(playerid, ime, sizeof(ime));
   format(string, sizeof(string), "Dobrodosli %s!\nTvoje ime nije registrirano.Unesi svoju lozinku.", ime);
       ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registriranje", string, "Registracija", "Odustani");
   }
   if(fexist(file))
   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Logiranje", "Upisite svoju lozinku", "Login", "Leave");
   }
   }


OnPlayerSpawn:
  if(IsPlayerNPC(playerid))
 {
   new npcname[MAX_PLAYER_NAME];
   GetPlayerName(playerid, npcname, sizeof(npcname));
   if(!strcmp(npcname, "lowara", true))
   {
     PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
   }
   return 1;
 }

i u jednu pozebnu skriptu sam radio ovo:
#define RECORDING "testbpt" //Ovo je ime filea koji ste snimali u igri.
#define RECORDING_TYPE 1 //1 ako ste bili u vozilu, 2 na nogama.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif

public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);




Radio sam po ovom tutorialu:
http://forum.sa-mp.com/showthread.php?t=110141
Poslednja Izmena: Januar 25, 2011, 18:24:07 POSLE PODNE od [ST]Stjepan_Fox