Jump to content
  • 0

problema noua npc


Andr3y

Question

15 answers to this question

Recommended Posts

LOL ... pe camp ? Vai de steaua lui de NPC.Uite aici :

[pawn]//-------------------------------------------------------------------------------------------------------

#include <a_samp>

//-------------------------------------------------------------------------------------------------------

new Vehiculul; // Numele vehiculului.

//-------------------------------------------------------------------------------------------------------

public OnGameModeInit()

{

        ConnectNPC("NPC","Inregistrare"); // Schimba NPC cu numele NPC-ului si Inregistrare cu numele inregistrari.

        Vehiculul = AddStaticVehicle(448,2076.4067,2227.7834,10.4165,178.8465,6,6);

        return 1;

}

//-------------------------------------------------------------------------------------------------------

public OnPlayerSpawn(playerid)

{

    if(!IsPlayerNPC(playerid)) return 0;

    new playername[64];

    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername, "NPC", true)) // Schimba NPC cu numele NPC-ului tau.

    SetSpawnInfo( playerid, 0, 255, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );

    SetPlayerColor(playerid,0xFFFFFFFF); // Schimba culoarea.Momentan este alb.

    PutPlayerInVehicle(playerid, Vehiculul, 0);

  return 1;

}

//-------------------------------------------------------------------------------------------------------

public OnPlayerConnect(playerid)

{

        if(IsPlayerNPC(playerid)) {

            new ip_addr_npc[64+1];

            new ip_addr_server[64+1];

            GetServerVarAsString("bind",ip_addr_server,64);

            GetPlayerIp(playerid,ip_addr_npc,64);

            if(!strlen(ip_addr_server)) {

            ip_addr_server = "127.0.0.1";

            }

            if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {

            printf("NPC: Se primeste o conectiune de la %s.Primeste kick.",ip_addr_npc);

            Kick(playerid);

            return 0;

            }

            printf("NPC : Conectiunea de la %s este permisa.",ip_addr_npc);

        }

        return 1;

}

//-------------------------------------------------------------------------------------------------------[/pawn]

Link to comment
Share on other sites

Ai pus asa ? :

[pawn]public OnGameModeInit()

{

        ConnectNPC("NPC","Inregistrare"); // Schimba NPC cu numele NPC-ului si Inregistrare cu numele inregistrari.

        Vehiculul = AddStaticVehicle(448,2076.4067,2227.7834,10.4165,178.8465,6,6);

        return 1;

}[/pawn]

si asa ? :

[pawn]public OnPlayerConnect(playerid)

{

        if(IsPlayerNPC(playerid)) {

            new ip_addr_npc[64+1];

            new ip_addr_server[64+1];

            GetServerVarAsString("bind",ip_addr_server,64);

            GetPlayerIp(playerid,ip_addr_npc,64);

            if(!strlen(ip_addr_server)) {

            ip_addr_server = "127.0.0.1";

            }

            if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {

            printf("NPC: Se primeste o conectiune de la %s.Primeste kick.",ip_addr_npc);

            Kick(playerid);

            return 0;

            }

            printf("NPC : Conectiunea de la %s este permisa.",ip_addr_npc);

        }

        return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.