SA-MP Forums Archive
NPC bots bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC bots bug (/showthread.php?tid=476836)



NPC bots bug - skydux123 - 20.11.2013

Hello everybody I have another bug in my gamemode i'll try to create NPC who rides around the city, and it's almost done but again I have mistake...
Code:
In npcmodes:
Код:
#define RECORDING "taksioras" //Jūsų failo pavadinimas.
#define RECORDING_TYPE 1 //1 reiљkia, kad veiksmas vyko transporte, o 2 reiљkia, kad veiksmas buvo ant kojų.

#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
In my Gamemode:
INIT
Код:
    ConnectNPC("Taksistas","taksioras");
    TaksiMasina = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 6, 6, 5000);
in OnPlayerSpawn:
Код:
if(IsPlayerNPC(playerid)) //Tikrina, ar ћaidėjas paleistas kaip NPC botas.
    {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Gauna NPC boto vardą.
    if(!strcmp(npcname, "Pardaveja", true)) //Tikrina, ar NPC boto vardas Martin_M
        {
        SetPlayerSkin(playerid, 76);
        }
    if(!strcmp(npcname, "Pardaveja_A", true)) //Tikrina, ar NPC boto vardas Martin_M
        {
        SetPlayerSkin(playerid, 76);
        }
	if(!strcmp(npcname, "Taksistas", true)) //Ar čia taksistas?
	    {
	    PutPlayerInVehicle(playerid, TaksiMasina, 0);
	    SetPlayerSkin(playerid, 189);
	    }
    return 1;
    }
The NPC Pardaveja and Pardaveja_A spawns, but the NPC taksistas doesen't run, but connect...
Server_LOG:
Код:
[21:11:02] [npc:join] Pardaveja_A has joined the server (0:127.0.0.1)
[21:11:02] [npc:join] Pardaveja has joined the server (1:127.0.0.1)
[21:11:02] [npc:join] Taksistas has joined the server (2:127.0.0.1)
Thanks in advice for helpin


Re: NPC bots bug - skydux123 - 22.11.2013

Can anyone help me?


Re: NPC bots bug - skydux123 - 22.11.2013

Bump