Help, what is the problem? [NPC script]
#1

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

#include <a_samp>
new HydraVehicle;
public OnFilterScriptInit()
{
ConnectNPC ( "Hydra", "hydra_ls");
	print("\n--------------------------------------");
	print(" Bluebay Hydra (LS)-->NPC Betцltve!");
	print("--------------------------------------\n");
	HydraVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
}

	public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "HydraVehicle", true));
        {
            PutPlayerInVehicle(playerid, HydraVehicle, 0);
            return 1;
        }
        return 1;
    }
    //Normбl dolgok jцhetnek ide
    return 1;
}
The problem:
I have 1 error

Quote:

C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(10) : warning 217: loose indentation
C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(22) : error 036: empty statement
C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(27) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Help me Thanks
Reply
#2

Try remove 1 of the return 1's you have.
Reply
#3

pawn Код:
#include <a_samp>
new HydraVehicle;
public OnFilterScriptInit()
{
    ConnectNPC ( "Hydra", "hydra_ls");
    print("\n--------------------------------------");
    print(" Bluebay Hydra (LS)-->NPC Betцltve!");
    print("--------------------------------------\n");
    HydraVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "HydraVehicle", true));
        {
            PutPlayerInVehicle(playerid, HydraVehicle, 0);
        }
        return 1;
    }
    return 1;
}
Reply
#4

Which?

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

#include <a_samp>
new HydraVehicle;
public OnFilterScriptInit()
{
ConnectNPC ( "Hydra", "hydra_ls");
	print("\n--------------------------------------");
	print(" Bluebay Hydra (LS)-->NPC Betцltve!");
	print("--------------------------------------\n");
	HydraVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
}

	public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "HydraVehicle", true));
        {
            PutPlayerInVehicle(playerid, HydraVehicle, 0);
            return 1;
        }
        return 1;
    }
now:
Quote:

C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(10) : warning 217: loose indentation
C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(22) : error 036: empty statement
C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(27) : warning 225: unreachable code
C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(29) : warning 209: function "OnPlayerSpawn" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Reply
#5

Quote:
Originally Posted by Bluebay
Посмотреть сообщение
Which?

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

#include <a_samp>
new HydraVehicle;
public OnFilterScriptInit()
{
ConnectNPC ( "Hydra", "hydra_ls");
	print("\n--------------------------------------");
	print(" Bluebay Hydra (LS)-->NPC Betцltve!");
	print("--------------------------------------\n");
	HydraVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
}

	public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "HydraVehicle", true));
        {
            PutPlayerInVehicle(playerid, HydraVehicle, 0);
            return 1;
        }
        return 1;
    }
now:
The answer is obove this post by Ricop522
Reply
#6

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
pawn Код:
#include <a_samp>
new HydraVehicle;
public OnFilterScriptInit()
{
    ConnectNPC ( "Hydra", "hydra_ls");
    print("\n--------------------------------------");
    print(" Bluebay Hydra (LS)-->NPC Betцltve!");
    print("--------------------------------------\n");
    HydraVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "HydraVehicle", true));
        {
            PutPlayerInVehicle(playerid, HydraVehicle, 0);
        }
        return 1;
    }
    return 1;
}
good, now just the error :

C:\Szerverek\MFA MOD\filterscripts\hydra_ls.pwn(1 : error 036: empty statement
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)