Invalid Function or declaration
#1

hello, im scripting a random script (learning scripting exactly)
but i got this error when trying to make a script that give someone money
Код:
D:\Bart\Samp Server\filterscripts\BRMember.pwn(126) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
This is the commands line where the error appear
also, idk why, but the car fix isn't working even u are in car (i want it to not work when u are not in a car and work if u are in car)
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/brfix", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInAnyVehicle(GetPlayerVehicleID(playerid)))
        {
        	RepairVehicle(GetPlayerVehicleID(playerid));
        	return SendClientMessage(playerid, COLOR_YELLOW, "LS-SW AAD: Your Vehicle is now fixed");
		}
       	else return SendClientMessage(playerid, COLOR_YELLOW,"Please get in a car");
	}
	else return SendClientMessage(playerid, COLOR_YELLOW,"Please get in a car");
}

    if (strcmp("/brrob", cmdtext, true, 10) == 1) //error appear in this line
    {
		GivePlayerMoney(playerid,10000);
		SendClientMessage(playerid, COLOR_GREEN,"Robbery Successful! $10000");
	}
}
Thank you
Reply
#2

which line is 126?
Reply
#3

Quote:
Originally Posted by Godzilla8957
Посмотреть сообщение
which line is 126?
the one i commented
Код:
    if (strcmp("/brrob", cmdtext, true, 10) == 1) //error appear in this line
Reply
#4

PHP код:
    if (strcmp("/brrob"cmdtexttrue10) ==  0//error appear in this line
    
{
        
GivePlayerMoney(playerid,10000);
        
SendClientMessage(playeridCOLOR_GREEN,"Robbery Successful! $10000");
    }

try this
Reply
#5

Quote:
Originally Posted by Godzilla8957
Посмотреть сообщение
PHP код:
    if (strcmp("/brrob"cmdtexttrue10) ==  0//error appear in this line
    
{
        
GivePlayerMoney(playerid,10000);
        
SendClientMessage(playeridCOLOR_GREEN,"Robbery Successful! $10000");
    }

try this
ok its now fixed
but its messed with other command
when i type "/brrob" its not working but "/brrib"works lol
and when i type "/brchangeteam" it give me money (/brrob function) lol!!
then "/brbtest" it gives me both :v

i updated the script
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/brmember", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "______List Of BR Members____");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]FaqahaT__       - Leader/Founder");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Grifas          - Leader");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Pranesh         - BR Executive");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Robin_Vinci     - BR Pro Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Tuningstyle[JG] - BR Pro Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]ChronicZ        - BR Pro Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]NWA[JG]         - BR Pro Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Yahya__         - BR Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Sarkozy         - BR Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Viper           - BR Member");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Ali             - BR Trial");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Rat3d_R3o       - BR Trial");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]RealCat_        - BR Trial");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Shawn           - BR Trial");
        SendClientMessage(playerid, COLOR_DARKGREY, "- [BR]Rubezz101       - BR Trial");

        return 1;
    }
    if (strcmp("/brfix", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInAnyVehicle(GetPlayerVehicleID(playerid)))
        {
        	RepairVehicle(GetPlayerVehicleID(playerid));
        	return SendClientMessage(playerid, COLOR_YELLOW, "_|LS-SW|_ AAD: Your Vehicle is now fixed");
		}
       	else return SendClientMessage(playerid, COLOR_YELLOW,"_|LS-SW|_ AAD: Where is your car noob!");
	}

    if (strcmp("/brrob", cmdtext, true, 10) == 1)
    {
		GivePlayerMoney(playerid,10000);
		SendClientMessage(playerid, COLOR_GREEN,"_|LS-SW|_ AAD: Robbery Successful! $10000");
	}

    if (strcmp("/brchangeteam", cmdtext, true, 10) == 1)
    {
        ForceClassSelection(playerid);
        SendClientMessage(playerid, COLOR_YELLOW,"_|LS-SW|_ AAD: Change Team Success");
	}
	return 1;
}
it doesn't give any error, only the command is messed up
Reply
#6

PHP код:
{
    if (
strcmp("/brmember"cmdtexttrue10) == 0)
    {
        
SendClientMessage(playeridCOLOR_DARKGREY"______List Of BR Members____");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]FaqahaT__       - Leader/Founder");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Grifas          - Leader");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Pranesh         - BR Executive");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Robin_Vinci     - BR Pro Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Tuningstyle[JG] - BR Pro Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]ChronicZ        - BR Pro Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]NWA[JG]         - BR Pro Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Yahya__         - BR Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Sarkozy         - BR Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Viper           - BR Member");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Ali             - BR Trial");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Rat3d_R3o       - BR Trial");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]RealCat_        - BR Trial");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Shawn           - BR Trial");
        
SendClientMessage(playeridCOLOR_DARKGREY"- [BR]Rubezz101       - BR Trial");
        return 
1;
    }
    if (
strcmp("/brfix"cmdtexttrue10) == 0)
    {
        if (
IsPlayerInAnyVehicle(GetPlayerVehicleID(playerid)))
        {
            
RepairVehicle(GetPlayerVehicleID(playerid));
            return 
SendClientMessage(playeridCOLOR_YELLOW"_|LS-SW|_ AAD: Your Vehicle is now fixed");
        }
           else return 
SendClientMessage(playeridCOLOR_YELLOW,"_|LS-SW|_ AAD: Where is your car noob!");
        return 
1;    
        }
    if (
strcmp("/brrob"cmdtexttrue10) ==  0)
    {
        
GivePlayerMoney(playerid,10000);
        
SendClientMessage(playeridCOLOR_GREEN,"_|LS-SW|_ AAD: Robbery Successful! $10000");
        return 
1;
    }
    if (
strcmp("/brchangeteam"cmdtexttrue10) ==  0)
    {
        
ForceClassSelection(playerid);
        
SendClientMessage(playeridCOLOR_YELLOW,"_|LS-SW|_ AAD: Change Team Success");
    }
    return 
1;

try this, and if it doesn't work than i have no clue
Reply
#7

sorry for bumping
i got same error again
the error appear after i canged the "dialogid" part
here is the code
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#define COLOR_YELLOW 0xFFFF00AA
#include <a_samp>


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" MP3 Player By [BR]Yahya");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mp3", cmdtext, true) == 0)
    {
        print("someone used the mp3! lol");
        ShowPlayerDialog(playerid, 22, DIALOG_STYLE_LIST, "_____________|Los Santos Street Wars MP3 Player|_____________", "test", "Play", "Cancel");
       
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, 22, response, listitem, inputtext[]) // ERROR APPEAR HERE
{
    if(22 == 1 && response == 1)
    {
        if(response)
        {

            if(listitem == 0)
            {
                 PlayAudioStreamForPlayer(playerid,"Url.mp3");
                 SendClientMessage(playerid, COLOR_YELLOW, "Playing test");
                 return 1;
        }
            return 1;
    }
    return 0;
}
samp wiki said
Quote:

dialogid The ID of the dialog the player responded to, assigned in ShowPlayerDialog.


any help please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)