Please help me ASAP
#1

Hi

I have this problem where it says : "Run time error 20: "Invalid index parameter (bad entry point)"
But I tried to fix it, and added main ( ) { }
And downloaded crashdetect, but the error is still here..
I tried to compare a new 'Untitled' pwn file with my gamemode, Then I found that I have to add #else under OnFilterScriptExit and #endif like that :
public OnFilterScriptExit()
{
return 1;
}

#else

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

#endif

But that didn't work too.. and the server isn't opening anymore and it's saying :
I couldn't load any gamemode scripts. Please verify your server.cfg
[22:09:06] It needs a gamemode0 line at the very least.
And yeah ofc, I added the gamemode in the line..

Hope anyone can help me!!
Reply
#2

Try it with code

PHP код:
#include <a_samp>

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

public 
OnGameModeInit()
{
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}


public 
OnGameModeExit()
{
    return 
1;
}


public 
OnPlayerConnect(playerid)
{
    return 
1;
}


public 
OnPlayerDisconnect(playeridreason)
{
    return 
1;

Compile and open server.cfg and edit this line

gamemode0 zombie Change "zombie" to your name file gamemode and save. before run samp-server.exe
Reply
#3

I'm sorry, but If I do that, I'll have to delete this..
PHP код:
public OnFilterScriptInit()
{
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
AddRandomMessage("");
    
SetTimer("SendRandomMessage"MESSAGE_INTERVAL 10001);
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;

And yep, I wrote the messages between ("likethat");
Reply
#4

it can only be filterscript or gamemode... cant be both just put those statements in ongamemodeinit ?
Reply
#5

I removed public OnFilterScriptInit()
and public OnFilterScriptExit()
and put all those AddRandomMessage in public OnGameModeInit()
But it says now : error 017: undefined symbol "AddRandomMessage"
Reply
#6

Quote:
Originally Posted by SuperZak
Посмотреть сообщение
I removed public OnFilterScriptInit()
and public OnFilterScriptExit()
and put all those AddRandomMessage in public OnGameModeInit()
But it says now : error 017: undefined symbol "AddRandomMessage"
Coz you are doing it wrong
Try this
Код:
//add this somewhere above your ongamemodeinit
#define  AUTO_MESSAGE_TIME a // Change "a" to a specific time you want i.e 5
new AutoMessages[][] = {
	// Write Your messages here i.e Hey cheating is not allowed on my server
};
//Now you'll need to forward it so that it can be timed on OnGameModeInit()
forward AutoMessage();
public AutoMessage() {
	new string[128];
	format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]);
	SendClientMessageToAll("YOUR COLOR HERE", string);
	return 1;
}

public OnGameModeInit()
{
    SetTimer("AutoMessage",60*1000*AUTO_MESSAGE_TIME,1);
    return 1;
}
tell me when there is something wrong

You can also random the colors like this
Код:
forward AutoMessage();
public AutoMessage() {
	new string[128];
	format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]);
	new colors = random(5)+1;
	new color;
	switch(colors)
	{
	    case 1:
	    {
	        color = COLOR_FORSTATS;
	    }
	    case 2:
	    {
	        color = COLOR_PURPLE;
	    }
	    case 3:
	    {
	        color = COLOR_LIGHTRED;
	    }
		case 4:
	    {
	        color = COLOR_GREEN;
	    }
	    case 5:
	    {
	        color = COLOR_CYAN;
	    }
	}
	SendClientMessageToAll(color, string);
	return 1;
}
but of course it can still be simplified
Reply
#7

Thanks joker, that really helped me, but now I get this errors ;-;
PHP код:
C:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(3) : error 017undefined symbol "print"
C:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(3) : warning 215expression has no effect
C
:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(3) : error 001expected token";"but found ")"
C:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(3) : error 029invalid expressionassumed zero
C
:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(3) : fatal error 107too many error messages on one line 
Nothing is wrong with the line 3 tho, Here it is
PHP код:
main()
: {
:    print("\n----------------------------------");
:    print(" Steven's stunts!");
:    print("----------------------------------\n");
: } 
Reply
#8

have you added your includes?

Код:
1 : main()  <-- on number 1?
2 : { 
3 :    print("\n----------------------------------"); 
4 :    print(" Steven's stunts!"); 
5 :    print("----------------------------------\n"); 
6 : }
If you have added the includes

try checking the things above it like maybe you have variables that doesn't have semicolon.

If you copied this form another text editor then, I don't know what's wrong, maybe try updating the includes?

If you have the latest include can you tell me where you added the main().
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)