Command Error
#1

So I have a problem ... I recently created a fs, or rather I try I did everything right but one problem I get an error ....
Код:
C:\Documents and Settings\RockStar\Desktop\CarsDialog.pwn(147) : error 001: expected token: "#endif", but found "-end of file-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
When I want to try the FS , i put it in the fileliscripts folder and in server.cfg ... i enter on server and i type a command and nothing happen ... and i don't know what the problem is ...
Please help me !
I was thinking you need to see the fs ....
Код:
#include <a_samp>
#define Cars
#define COLOR_ORANGE 0xFF9900AA
#if defined FILTERSCRIPT


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("   Cars - Dialog by RockStar - Loaded -");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	print("\n----------------------------------");
	print(" Cars - Dialog by RockStar - Unloaded ");
	print("----------------------------------\n");
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/dhelp", cmdtext, true, 10) == 0)
{
	SendClientMessage(playerid,0xAA3333AA," ");
	SendClientMessage(playerid,0xD8D8D8FF," ");
	new Float:x,Float:y,Float:z;
	PlayerPlaySound(playerid,1133,x,y,z);
	SendClientMessage(playerid,0xAA3333AA,"==================Cars-Dialog-Help=================");
	SendClientMessage(playerid,0xD8D8D8FF,"Ajutor/Comenzi :");
	SendClientMessage(playerid,0xD8D8D8FF," /dcars - Un dialog cu 4 masini la alegere");
	SendClientMessage(playerid,0xD8D8D8FF," /dcredits - Creditele acestui [FS]");
	SendClientMessage(playerid,0xD8D8D8FF," /fix - Pentru a repara masinile");
	SendClientMessage(playerid,0xD8D8D8FF," /blog - Pentru a vizita blog-ul meu");
	SendClientMessage(playerid,0xAA3333AA,"==================Cars-Dialog-Help=================");
	return 1;
}
	if (!strcmp(cmdtext, "/dcars", true))
	{
		ShowPlayerDialog(playerid, Cars, DIALOG_STYLE_LIST, "Cars - Dialog", "NRG-500\nElegy\nSultan\nInfernus\nTurismo", "Spawn", "Cancel");
		return 1;
	}
    if(strcmp(cmd, "/dcredits", true) == 0)
    {
		SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
		SendClientMessage(playerid, 0xFF9900AA,"Car-Dialog [FS] Created by RockStar aka RaZor1911");
		SendClientMessage(playerid, 0xFF9900AA,"Nu uita niciodata nu schimba creditele unui [FS] care nu iti apartine");
		SendClientMessage(playerid, 0xFF9900AA,"Si multumiri acestui server pentru ca foloseste Cars-Dialog");
		SendClientMessage(playerid, 0xFF9900AA,"Multumesc ca ai citit creditele");
		SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
	}
	return 1;
	}
	if(strcmp(cmdtext,"/fix",true)==0)
    {
    if(GetPlayerMoney(playerid) < -10)
    {
       SendClientMessage(playerid,COLOR_RED,"Ai nevoie de 10$ pentru a putea folosi comanda /fix!");
    return 1;
    }
new vehicleid=GetPlayerVehicleID(playerid);
        RepairVehicle(vehicleid);
        SendClientMessage(playerid,COLOR_GREEN,"Vehicul dvs. a fost reparat!");
    return 1;
    }
    if(strcmp(cmd, "/blog", true) == 0)
	{
	if(Roman[playerid] == 0)
    {
	SendClientMessage(playerid, 0xFFFF00AA,"Nu uita sa vizitezi blog-ul  http://skyblogger.hi2.ro");
	}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == Cars)
	{
	    switch(listitem)
	    {
	        case 0: //NRG-500
	            {
	                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
	                Int = GetPlayerInterior(playerid);
	                GetPlayerPos(playerid, X, Y, Z);
	                GetPlayerFacingAngle(playerid, Ang);
					pVeh = CreateVehicle(522, X, Y, Z, Ang, 0, 0, -1);
					LinkVehicleToInterior(pVeh, Int);
					PutPlayerInVehicle(playerid, pVeh, 0);
				}
			case 1: //Elegy
			    {
       				new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
	                Int = GetPlayerInterior(playerid);
	                GetPlayerPos(playerid, X, Y, Z);
	                GetPlayerFacingAngle(playerid, Ang);
					pVeh = CreateVehicle(562, X, Y, Z, Ang, 0, 0, -1);
					LinkVehicleToInterior(pVeh, Int);
					PutPlayerInVehicle(playerid, pVeh, 0);
				}
			case 2: //Sultan
			    {
       				new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
	                Int = GetPlayerInterior(playerid);
	                GetPlayerPos(playerid, X, Y, Z);
	                GetPlayerFacingAngle(playerid, Ang);
					pVeh = CreateVehicle(560, X, Y, Z, Ang, 0, 0, -1);
					LinkVehicleToInterior(pVeh, Int);
					PutPlayerInVehicle(playerid, pVeh, 0);
				}
			case 3: //Infernus
			    {
       				new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
	                Int = GetPlayerInterior(playerid);
	                GetPlayerPos(playerid, X, Y, Z);
	                GetPlayerFacingAngle(playerid, Ang);
					pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
					LinkVehicleToInterior(pVeh, Int);
					PutPlayerInVehicle(playerid, pVeh, 0);
				}
				case 4: //Turismo
			    {
       				new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
	                Int = GetPlayerInterior(playerid);
	                GetPlayerPos(playerid, X, Y, Z);
	                GetPlayerFacingAngle(playerid, Ang);
					pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
					LinkVehicleToInterior(pVeh, Int);
					PutPlayerInVehicle(playerid, pVeh, 0);
				}
			}
	}
	return 1;
}
#endif
What's wrong with it?
Do not laugh at me ... is my first FS ...
And sorry for my bad english ...
Reply
#2

#endif

at the the end.
Reply
#3

If i delete #endif i get this Error ...
Код:
C:\Documents and Settings\RockStar\Desktop\CarsDialog.pwn(146) : error 001: expected token: "#endif", but found "-end of file-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

i dont see the point of using

Код:
#if defined FILTERSCRIPT
delete it as well because you know it a filterscript
Reply
#5

If i delete #if defined FILTERSCRIPT i get Don't Send Error ...
Reply
#6

i think i get it why

you made the if statemtn, if FILTERSCIPRT is defined but it isnt so it pases out the code but you have wrong number of } compared to { so you get errors

Код:
    if(strcmp(cmd, "/dcredits", true) == 0)
    {
		SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
		SendClientMessage(playerid, 0xFF9900AA,"Car-Dialog [FS] Created by RockStar aka RaZor1911");
		SendClientMessage(playerid, 0xFF9900AA,"Nu uita niciodata nu schimba creditele unui [FS] care nu iti apartine");
		SendClientMessage(playerid, 0xFF9900AA,"Si multumiri acestui server pentru ca foloseste Cars-Dialog");
		SendClientMessage(playerid, 0xFF9900AA,"Multumesc ca ai citit creditele");
		SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
	}
	return 1;
	}
you have two }} and one {

i think the problem is solved unless i red the code wrongly then im sorry
Reply
#7

pawn Код:
#include <a_samp>
#define CARS 10000
#define COLOR_ORANGE 0xFF9900AA

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("   Cars - Dialog by RockStar - Loaded -");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n----------------------------------");
    print(" Cars - Dialog by RockStar - Unloaded ");
    print("----------------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/dhelp", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0xAA3333AA," ");
        SendClientMessage(playerid,0xD8D8D8FF," ");
        new Float:x,Float:y,Float:z;
        PlayerPlaySound(playerid,1133,x,y,z);
        SendClientMessage(playerid,0xAA3333AA,"==================Cars-Dialog-Help=================");
        SendClientMessage(playerid,0xD8D8D8FF,"Ajutor/Comenzi :");
        SendClientMessage(playerid,0xD8D8D8FF," /dcars - Un dialog cu 4 masini la alegere");
        SendClientMessage(playerid,0xD8D8D8FF," /dcredits - Creditele acestui [FS]");
        SendClientMessage(playerid,0xD8D8D8FF," /fix - Pentru a repara masinile");
        SendClientMessage(playerid,0xD8D8D8FF," /blog - Pentru a vizita blog-ul meu");
        SendClientMessage(playerid,0xAA3333AA,"==================Cars-Dialog-Help=================");
        return 1;
    }
    if (!strcmp(cmdtext, "/dcars", true))
    {
        ShowPlayerDialog(playerid, CARS, DIALOG_STYLE_LIST, "Cars - Dialog", "NRG-500\nElegy\nSultan\nInfernus\nTurismo", "Spawn", "Cancel");
        return 1;
    }
    if(strcmp(cmd, "/dcredits", true) == 0)
    {
        SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
        SendClientMessage(playerid, 0xFF9900AA,"Car-Dialog [FS] Created by RockStar aka RaZor1911");
        SendClientMessage(playerid, 0xFF9900AA,"Nu uita niciodata nu schimba creditele unui [FS] care nu iti apartine");
        SendClientMessage(playerid, 0xFF9900AA,"Si multumiri acestui server pentru ca foloseste Cars-Dialog");
        SendClientMessage(playerid, 0xFF9900AA,"Multumesc ca ai citit creditele");
        SendPlayerFormattedText(playerid,"==================Cars-Dialog-Credits=================",0);
        return 1;
    }
    if(strcmp(cmdtext,"/fix",true)==0)
    {
        if(GetPlayerMoney(playerid) < -10)
        {
            SendClientMessage(playerid,COLOR_RED,"Ai nevoie de 10$ pentru a putea folosi comanda /fix!");
            return 1;
        }
        new vehicleid=GetPlayerVehicleID(playerid);
        RepairVehicle(vehicleid);
        SendClientMessage(playerid,COLOR_GREEN,"Vehicul dvs. a fost reparat!");
        return 1;
    }
    if(strcmp(cmd, "/blog", true) == 0)
    {
        if(Roman[playerid] == 0)
        {
            SendClientMessage(playerid, 0xFFFF00AA,"Nu uita sa vizitezi blog-ul  http://skyblogger.hi2.ro");

        }
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == CARS)
    {
        switch(listitem)
        {
            case 0: //NRG-500
            {
                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                Int = GetPlayerInterior(playerid);
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                pVeh = CreateVehicle(522, X, Y, Z, Ang, 0, 0, -1);
                LinkVehicleToInterior(pVeh, Int);
                PutPlayerInVehicle(playerid, pVeh, 0);
            }
            case 1: //Elegy
            {
                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                Int = GetPlayerInterior(playerid);
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                pVeh = CreateVehicle(562, X, Y, Z, Ang, 0, 0, -1);
                LinkVehicleToInterior(pVeh, Int);
                PutPlayerInVehicle(playerid, pVeh, 0);
            }
            case 2: //Sultan
            {
                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                Int = GetPlayerInterior(playerid);
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                pVeh = CreateVehicle(560, X, Y, Z, Ang, 0, 0, -1);
                LinkVehicleToInterior(pVeh, Int);
                PutPlayerInVehicle(playerid, pVeh, 0);
            }
            case 3: //Infernus
            {
                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                Int = GetPlayerInterior(playerid);
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
                LinkVehicleToInterior(pVeh, Int);
                PutPlayerInVehicle(playerid, pVeh, 0);
            }
            case 4: //Turismo
            {
                new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                Int = GetPlayerInterior(playerid);
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
                LinkVehicleToInterior(pVeh, Int);
                PutPlayerInVehicle(playerid, pVeh, 0);
            }
        }
    }
    return 1;
}
You should read some pawn tutorials or something, you were defining a dialogid with no value.. you have an unset variable, etc..

Also, you had functions placed no where..

Anyway, if you don't fix it, it won't compile.
Reply
#8

Try that

http://pastebin.com/SkzXqqxx

EDIT: CBA to indent, and The Moddler beat me..
Reply
#9

No , it,s not that ... still same errors ...
Reply
#10

Quote:
Originally Posted by AntiGuardian
Посмотреть сообщение
No , it,s not that ... still same errors ...
Read my post..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)