SA-MP Forums Archive
Help, what is the problem? [NPC script] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help, what is the problem? [NPC script] (/showthread.php?tid=236571)



Help, what is the problem? [NPC script] - Bluebay - 07.03.2011

Код:
// 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


Re: Help, what is the problem? [NPC script] - Stigg - 07.03.2011

Try remove 1 of the return 1's you have.


Re: Help, what is the problem? [NPC script] - Ricop522 - 07.03.2011

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;
}



Re: Help, what is the problem? [NPC script] - Bluebay - 07.03.2011

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.




Re: Help, what is the problem? [NPC script] - Stigg - 07.03.2011

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


Re: Help, what is the problem? [NPC script] - Bluebay - 07.03.2011

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.