simple NPC script
#1

Hi, could anyone create a simple npc script that i can put in my gamemode ?

Simply connect the NPC to the server then just play the same .rec file when it finishes once, play it again.
The record i made was /vrecord so only a vehicle. Just need the vehicle to drive around, can anyone create the code for me? I tried doing it for hours its just not happening.


I will +rep you for rest of ur lifeeeee!
Reply
#2

Whats the NPC's name and the recordings name?
Reply
#3

NPC name Johnny_Driver and recording name bus1 Could anyone help ? Please?
Reply
#4

Add something like this into your script but change the xyz's with your own and if you have any questions feel free to PM me
pawn Код:
new Bus;
public OnGameModeInit()
{
        ConnectNPC("Johnny_Driver","bus1");
        Bus = AddStaticVehicle(431,x, y, z, float,0,0);
        return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"Johnny_Driver",true))
    {
        SetSpawnInfo(playerid,69,61,x,y,z,0.0,-1,-1,-1,-1,-1,-1);
    }
        return 1;
}
public OnPlayerSpawn(playerid)
{
    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"Johnny_Driver",true))
        {
        PutPlayerInVehicle(playerid, Bus, 0);
        SetPlayerColor(playerid,0xFF0000FF);
    }        
}
stock SetVehicleTireStatus(vehicleid, tirestatus)
{
    new panels, doors, lights, tires;
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tirestatus);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)