SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/06/2012, 07:36 AM   #1
reh_007
Big Clucker
 
Join Date: Nov 2011
Location: In a ferrari next to you
Posts: 107
Reputation: 3
Default I get an error runtime error 6 'Invaild instruction'

Hello their, can you fix this run time rror 6, and also, fix the compiling error, and fix the script, put everything where sit should go, many regards, thanks.




// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
new gTeam[MAX_PLAYERS];

SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_GROVE;
}
else
{
gTeam[playerid] = TEAM_BALLA;
}

SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
}
#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
{

public OnGameModeInit()
{

// Add a Hydra to the game
AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1);
// Add a Infernus to the game
AddStaticVehicle(411,2272.9995,2417.2898,10.5450,8 9.0067,38,87);
// Add a Buffalo to the game
AddStaticVehicle(402,2109.6311,2354.1211,10.5438,1 11.7682,38,87);
// Add a Turismo to the game
AddStaticVehicle(451,2050.4319,2213.4856,10.6209,2 69.1336,38,87);
// Add a Nrg to the game
AddStaticVehicle(522,2155.9338,2207.4380,10.5433,1 95.6637,38,87);
// Add a Bullet to my game
AddStaticVehicle(541,2103.0132,2069.4316,10.6208,2 70.7972,38,87);


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)
SetPlayerToTeamColor(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("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
reh_007 is offline   Reply With Quote
Old 03/06/2012, 07:43 AM   #2
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,383
Reputation: 235
Default Re: I get an error runtime error 6 'Invaild instruction'

Put your code within [pawn][/ pawn] tags. (without spaces)

Also post the callback with the error not an entire mode/FS. Then at least i will have a look.
__________________
Quote:
Originally Posted by Y_Less
That code compiles perfectly, but I can tell you now it won't make me a cup of tea.
"No offense, but you are a stupid asshole." - Ron Burgundy
iggy1 is offline   Reply With Quote
Old 03/06/2012, 07:46 AM   #3
reh_007
Big Clucker
 
Join Date: Nov 2011
Location: In a ferrari next to you
Posts: 107
Reputation: 3
Default Re: I get an error runtime error 6 'Invaild instruction'

I dunno how man.
reh_007 is offline   Reply With Quote
Old 03/06/2012, 07:57 AM   #4
reh_007
Big Clucker
 
Join Date: Nov 2011
Location: In a ferrari next to you
Posts: 107
Reputation: 3
Default Re: I get an error runtime error 6 'Invaild instruction'

Please, Help like this.
reh_007 is offline   Reply With Quote
Old 03/06/2012, 08:02 AM   #5
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,383
Reputation: 235
Default Re: I get an error runtime error 6 'Invaild instruction'

http://wiki.sa-mp.com/wiki/Scripting_Basics

I took a little look and there is a lot wrong with it. Really the best advice would be start again but follow a tut.
__________________
Quote:
Originally Posted by Y_Less
That code compiles perfectly, but I can tell you now it won't make me a cup of tea.
"No offense, but you are a stupid asshole." - Ron Burgundy
iggy1 is offline   Reply With Quote
Old 03/06/2012, 08:03 AM   #6
reh_007
Big Clucker
 
Join Date: Nov 2011
Location: In a ferrari next to you
Posts: 107
Reputation: 3
Default Re: I get an error runtime error 6 'Invaild instruction'

Oh.. Ok. I will start again, then.
reh_007 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 6 - Invalid Instruction Scarred Scripting Help 3 15/12/2011 09:25 PM
[AYUDA]microsoft visual c++ runtime library runtime error Parka Espa˝ol/Spanish 1 01/09/2011 08:33 PM
error 049 invaild line HACKHERS Help Archive 14 03/06/2010 01:58 PM
RunTIme Error from Client... Mircrosoft Visual c++ Runtime Libary asdfgh98 Client Support 0 22/02/2010 04:08 PM
Microsoft visual c++ runtime library Runtime error! waringzone Client Support 3 16/06/2009 07:41 PM


All times are GMT. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.