Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

npc's runnen op samp-npc?

Hoe run ik mijn npc's op samp-npc, aangezien ik met mijn 2de npc loop te kloten denk ik dat het miss met samp-npc wel werkt.

Featured Replies

Hoe run ik mijn npc's op samp-npc, aangezien ik met mijn 2de npc loop te kloten denk ik dat het miss met samp-npc wel werkt.

Bedoel je spelers die je kunt spelen, of rondlopende mensen?

  • Author

Hoe run ik mijn npc's op samp-npc, aangezien ik met mijn 2de npc loop te kloten denk ik dat het miss met samp-npc wel werkt.

Bedoel je spelers die je kunt spelen, of rondlopende mensen?

gewoon npc's, ik heb er 1tje in een stretch die rijdt heen en weer tussen four dragons en caligulas.

nu wil ik er nog een die begint op caligulas, en de ander begint dan bij four dragons.

maar omdat die van caligulas niet wil spawnen, wil ik proberen om ze op samp-npc te runnen.

Ik snap het nog niet goed. De samp-npc.exe is het programmaatje dat alle NPC's aanstuurt en het kan bovendien ook niet onafhankelijk van de samp-server.exe worden gestart.

Wat gebeurt er nu eigenlijk met die tweede NPC? Connect hij wel maar spawnt niet?

  • Author

Wat gebeurt er nu eigenlijk met die tweede NPC? Connect hij wel maar spawnt niet?

juist, hij staat gewoon stil op de spawn.

toen dit bij mijn eerste npc gebeurde fixte ik het door te beginnen op line 1 in het script in de map npc modes.

maar bij de 2e npc heb ik dat wel meteen gedaan, en hij staat wel stil. de eerste doet het wel zoals het hoort :)

voor als je beniewd bent naar wat ik fout doe:P :

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new Stretch;
new limoo;
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
   ShowNameTags(1);
ConnectNPC("Amstel","nppc");
ConnectNPC("Heineken","cali");
Stretch = CreateVehicle(409, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
limoo = CreateVehicle(409, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
new Text3D:vehicle3Dtext;
new text3D:vehicle3Dtekst;
vehicle3Dtext = Create3DTextLabel("Four Dragons Casino <---> Caligulas Casino ", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
vehicle3Dtekst = Create3DTextLabel("Caligulas Casino <---> Four Dragons Casino ", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
       Attach3DTextLabelToVehicle(vehicle3Dtext, Stretch, 0.0, 0.0, 2.0);
SetGameModeText("Big Mac Menu 5 dollar");
AddPlayerClass(83, 2099.0916,1683.1937,13.0060,88.8639, 325, 367, 347, 353, 351, 321);
AddPlayerClass(84, 2099.0916,1683.1937,13.0060,88.8639, 325, 367, 347, 353, 351, 321);
AddPlayerClass(85, 2099.0916,1683.1937,13.0060,88.8639, 325, 367, 347, 353, 351, 321);
AddStaticVehicle(409, 2074.5491, 1682.1178, 10.6719, 180.0447, 0, 0, 5);
AddStaticVehicle(411, 2074.5625, 1664.3271, 10.6719, 180.0447, 1, 1, 5);
AddStaticVehicle(415, 2075.3418, 1692.9845, 10.6719, 177.8280, 6, 6, 5);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
   if(IsPlayerNPC(playerid)) return 1;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
//----- npc1
{
if(IsPlayerNPC(playerid))
    {
        new npcname [MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "Amstel", true))
		{
		   PutPlayerInVehicle(playerid, Stretch, 0);
}
return 1;
}
	if(IsPlayerNPC(playerid))
    {
        new npcname [MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "Heineken", true))
		{
		   PutPlayerInVehicle(playerid, limoo, 0);
}
return 1;
}
return 1;
}

edit:

cali.pwn/cali.amx in npcmodes:

#define RECORDING "cali"
#define RECORDING_TYPE 1
#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

Edited by minkema

Ik heb het al gevonden.

Als de tweede NPC spawnt, kijkt het script eerst of de naam Amstel is. Dat is niet zo, want het is de naam van de eerste NPC.

Vervolgens komt het script bij een return en kapt de callback af. Gevolg: Het stukje met de naam Heiniken zal nooit bereikt kunnen worden, en de NPC staat stil op de spawn.

public OnPlayerSpawn(playerid)
{
   if(IsPlayerNPC(playerid))
   {
       new npcname [MAX_PLAYER_NAME];
       GetPlayerName(playerid, npcname, sizeof(npcname));

       // ----- npc 1 -----        
       if(!strcmp(npcname, "Amstel", true))
       {
           PutPlayerInVehicle(playerid, Stretch, 0);
           SetPlayerSkin(playerid, 255); // Je kan 'm ook de skin van een driver geven. 
       }
       // ----- npc 2 -----
       else if(!strcmp(npcname, "Heineken", true))
       {
           PutPlayerInVehicle(playerid, limoo, 0);
           SetPlayerSkin(playerid, 255);
       }
       // ----- hieronder ga je verder als je nog npc's wil toevoegen.


   }

   // Hier komt alles voor normale spelers
   return 1;
}

  • Author

ah bedankt man

EDIT: aAH WTF?! als ik zelf spawn spawn in de stretch van 1 van mijn npcs, en de andere heeft geen vehicle :puh:

Edited by minkema

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.