Whats bad on this script?
#1

I'm working on a script catching the scripts from the wiki, and editing them and trying to understand. When i start the server with my gm it says, runtime eror 22 no index or something like that, whats bad?

ERORR: Script[gamemodes/learn.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Quote:

/*--------------------------------- Includes ---------------------------------*/
#include <a_samp>
/*--------------------------------- End Includes -----------------------------*/




/*--------------------------------- TextDraws Id's ---------------------------*/

new Text:hello;

/*--------------------------------- End TextDraws Id's -----------------------*/

public OnGameModeInit()
{

hello = TextDrawCreate(240.0,580.0," Hello Player!");
TextDrawColor(hello,0x000000FF);
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid,hello);
return 1;
}

Reply
#2

BUMP - URGENT!
Reply
#3

hmm let me look for amin
Reply
#4

add main() { } to your script, every script needs it
Reply
#5

i've added,

Quote:

main()
{
print("Learn Pawn Project - Simple v1");
}

it prints on the samp-server.exe, but my TextDraw isn't show, also i think i must define a spawn pos, how can i do that?
Reply
#6

I think your TextDraw coordinates are off the screen. Use 80 & 100 and see if it comes up.
Reply
#7

By adding a AddPlayerClass line @ OnGameModeInit

https://sampwiki.blast.hk/wiki/AddPlayerClass
Reply
#8

Thanks for spawn, also i changed into:

Quote:

#include <a_samp>

main()
{
print("Learn Pawn Project - Simple v1");

}

public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~Hello: ~r~DeatMatch GameMode",5000,5);
return 1;
}


public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}

Now is working when i loggin, but isn't the same Text as Textdraw or?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)