Need someone to fix the Pawno Code
#1

Hi.
I am making a simple movable barriel and some fences near LSPD, I am making it in filterscript but I am getting errors..

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

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

	new bool:newPlayer = false,bar;

public OnGameModeInit()
{

	//Fences

CreateObject(968, 1544.6999511719, -1630.6999511719, 13.300000190735, 0, 90, 90);
CreateObject(992, 1544.5999755859, -1621.0999755859, 14.10000038147, 0, 0, 86);
CreateObject(992, 1544.8000488281, -1618.5999755859, 14.10000038147, 0, 0, 84);
CreateObject(992, 1544.5, -1634.5999755859, 14.10000038147, 0, 0, 88);
CreateObject(992, 1544.1999511719, -1637.6999511719, 14.5, 0, 0, 88);
}

//Barriers
	bar = CreateObject(968, 1544.6999511719, -1630.6999511719, 13.300000190735, 352, 270, 90);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext,"/gate", cmdtext, true) == 0)
	{
	SetObjectPos(bar,1544.6999511719, -1630.6999511719, 13.300000190735);
	SetObjectPos(bar,252, 0,90);
	SetTimer("InitPos", 5000, false);
		return 1;
	}
	return 0;
}

public InitPos()
{
	SetObjectPos(bar,1544.6999511719, -1630.6999511719, 13.300000190735);
	SetObjectRot(bar,252, 0, 90)
}


These are the warnings:
Код:
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(48) : error 010: invalid function or declaration
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(49) : error 010: invalid function or declaration
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(102) : error 035: argument type mismatch (argument 3)
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(107) : warning 217: loose indentation
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(112) : warning 235: public function lacks forward declaration (symbol "InitPos")
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(116) : error 001: expected token: ";", but found "}"
C:\Users\Babar\Desktop\NEW ONE\filterscripts\barriel.pwn(117) : warning 203: symbol is never used: "newPlayer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

new bar;

public OnFilterScriptInit()
{
    CreateObject(968, 1544.6999511719, -1630.6999511719, 13.300000190735, 0, 90, 90);
    CreateObject(992, 1544.5999755859, -1621.0999755859, 14.10000038147, 0, 0, 86);
    CreateObject(992, 1544.8000488281, -1618.5999755859, 14.10000038147, 0, 0, 84);
    CreateObject(992, 1544.5, -1634.5999755859, 14.10000038147, 0, 0, 88);
    CreateObject(992, 1544.1999511719, -1637.6999511719, 14.5, 0, 0, 88);
   
    //Barriers
    bar = CreateObject(968, 1544.6999511719, -1630.6999511719, 13.300000190735, 352, 270, 90);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/gate", true))
    {
        SetObjectPos(bar, 1544.6999511719, -1630.6999511719, 13.300000190735);
        SetObjectPos(bar, 252, 0,90);
        SetTimer("InitPos", 5000, false);
        return 1;
    }
    return 0;
}

forward InitPos();
public InitPos()
{
    SetObjectPos(bar, 1544.6999511719, -1630.6999511719, 13.300000190735);
    SetObjectRot(bar, 252, 0, 90);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)