Jump to content

[0.3] Cum sa adaugi un NPC


cmg4life

Recommended Posts

salut..

deci asta E in Fs [pawn]// This is a comment

// uncomment the line below if you want to write a filterscript

#define FILTERSCRIPT

#include <a_samp>

new bus;

#if defined FILTERSCRIPT

public OnFilterScriptInit()

{

ConnectNPC("Lorenzo", "dave");

bus = CreateVehicle(431,1785.0498,-1929.7227,13.4885,0.8961,21,42,9999999);

}

#else

main()

{

print("\n----------------------------------");

print(" Blank Gamemode by your name here");

print("----------------------------------\n");

}

#endif

public OnPlayerSpawn(playerid)

{

    if(IsPlayerNPC(playerid)) //Verifica daca playerul este NPC

    {

        new npcname[MAX_PLAYER_NAME];

        GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului

        if(!strcmp(npcname, "Lorenzo", true)) //Verificam daca numele NPCului este "NUME"

        {

            PutPlayerInVehicle(playerid, bus, 0); //Punem NPCul in vehicul

        }

    }

return 1;

}

public OnPlayerDisconnect(playerid, reason)

{

return 1;

}

[/pawn]

asta este FS . nume [pawn]npc[/pawn]

acesta este in folderu npcmodes

[pawn]// This is a comment

// uncomment the line below if you want to write a filterscript

#define FILTERSCRIPT

#include <a_samp>

new bus;

#if defined FILTERSCRIPT

public OnFilterScriptInit()

{

ConnectNPC("Lorenzo", "dave");

bus = CreateVehicle(431,1785.0498,-1929.7227,13.4885,0.8961,21,42,9999999);

}

#else

main()

{

print("\n----------------------------------");

print(" Blank Gamemode by your name here");

print("----------------------------------\n");

}

#endif

public OnPlayerSpawn(playerid)

{

    if(IsPlayerNPC(playerid)) //Verifica daca playerul este NPC

    {

        new npcname[MAX_PLAYER_NAME];

        GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului

        if(!strcmp(npcname, "Lorenzo", true)) //Verificam daca numele NPCului este "NUME"

        {

            PutPlayerInVehicle(playerid, bus, 0); //Punem NPCul in vehicul

        }

    }

return 1;

}

public OnPlayerDisconnect(playerid, reason)

{

return 1;

}

[/pawn]  nume [pawn]Lorenzo[/pawn]

si mai am fiseru dave.rec in [pawn]recordings[/pawn]

deci intra pe svr numai ca mil da pe un camp .el trebuia sa conduca.

cum rezolv?

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 111
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
  • 1 month later...

Am cautat de am innebunit..unde gasesc fisierul npc_recorder.amx???

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 8 months later...

EDIT:REZOLVATA PRIMA EROARE!!!

Anakin" post="129048" timestamp="1357823932"]

Nu stii sa pui liniile no ? Pune liniile ca sa stim ...
k am sa pun liniile si scriptul  :tongue:
D:\GameModes\gamemodes\Ro.pwn(239) : error 017: undefined symbol "playerid"
D:\GameModes\gamemodes\Ro.pwn(242) : error 017: undefined symbol "playerid"
D:\GameModes\gamemodes\Ro.pwn(245) : error 017: undefined symbol "playerid"

Astea-s liniile.Acum sa pun scriptul:

[pawn]

if(IsPlayerNPC(playerid))

GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului

PutPlayerInVehicle(playerid, NPCvehicle, 0); //Punem NPCul in vehicul[/pawn]Asta-i scriptul de la care da eroare.Bineinteles ,is doar fragmentele corespondente liniilor ;)

Link to comment
Share on other sites

EDIT:REZOLVATA PRIMA EROARE!!!

k am sa pun liniile si scriptul  :tongue:
D:\GameModes\gamemodes\Ro.pwn(239) : error 017: undefined symbol "playerid"
D:\GameModes\gamemodes\Ro.pwn(242) : error 017: undefined symbol "playerid"
D:\GameModes\gamemodes\Ro.pwn(245) : error 017: undefined symbol "playerid"

Astea-s liniile.Acum sa pun scriptul:

[pawn]

if(IsPlayerNPC(playerid))

GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului

PutPlayerInVehicle(playerid, NPCvehicle, 0); //Punem NPCul in vehicul[/pawn]Asta-i scriptul de la care da eroare.Bineinteles ,is doar fragmentele corespondente liniilor ;)

Am facut o smecherie :))))) si nu mai da nici o eroare !!!:))

Link to comment
Share on other sites

  • 2 months later...
  • 9 years later...

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.