Addplayerclass and some other functions Missing???
#1

i just started mapmaking yesterday and i decided to spend some of my time making a simple gamemode just for the sake of it, but when i try compile it in Pawno it gives me a shitload of errors and doesnt reconignize the most common functions >.<

my whole code(pretty unstarted, was trying to test spawns)

Код:
#define TEAM_LV 1
#define TEAM_LS 2
#define TEAM_LS_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_LV_COLOR 0xFF0000AA // Bright Red
// THIS IS THE ORIGINAL INCASE I SCREW UP #define TEAM_LV_COLOR 0xFF00FFAA // Bright Purple

main()
{
//	print("\n----------------------------------");
//	print("Welcome to Airport TDM by Henry_Jiggy");
//	print("----------------------------------\n");
}

public OnGameModeInit()
{
 
	//REMOVE THIS COMMENT IF IT WORKS AddPlayerClass(1, 417.5400, 2495.6201, 15.7000, 0.0,  Weapon 350, Ammo 50, Weapon 356, Ammo 500, Weapon 371, Ammo 1);
	//This up here ^^ added a Sawn off, a M4 and a Parachute, for the LV team class.(In order)
	
	AddPlayerClass(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 5, 0, 22, 100, 32, 50);
	//ABOVE IS A TEST WHICH WAS ON THE TUTORIAL
	
	//VEHICLE SPAWN TIME :D

	AddStaticVehicle(487, Float:417.6300, Float:2515.0300, Float:15.7000, Float:0, 1, 1);
	//This up here added LV Maverick Spawn 1 at Helipad Location 1
	AddStaticVehicle(476, Float:425.4688, Float:2531.0000, Float:22.5547, Float:0, 1, 1);
	//This up here added LV Rustler Spawn 1 at one of the Open Hangars

	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)
{
	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;
}
Errors

Код:
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(14) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(20) : error 017: undefined symbol "AddPlayerClass"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(25) : error 017: undefined symbol "AddStaticVehicle"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : error 017: undefined symbol "AddStaticVehicle"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : error 029: invalid expression, assumed zero
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : warning 215: expression has no effect
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : warning 215: expression has no effect
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : warning 215: expression has no effect
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : warning 215: expression has no effect
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : error 001: expected token: ";", but found ")"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(27) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
What am i doing wrong?
Reply
#2

Add this on the top of your script
Код:
#include <a_samp>
Reply
#3

Oh... whoops. forgot to include SAMP functions on file, Lolz.

Worked ^^. now how to put my map objects on it and make SAMP run using it?
Reply
#4

Do u use MTA to map your objects?
Reply
#5

No, i use the Map Editor for SA-MP. i saved the Createobject and CreateDynamicObject commands into a .pwn file using it
Reply
#6

Select the hole CreateObject or CreateDyanmicObject and copy it under OnGameModeInit.
Reply
#7

Ok, and how to run a SAMP server(on localhost) using these settings now?
Reply
#8

https://sampwiki.blast.hk/wiki/Windows_Server if ur using windows
https://sampwiki.blast.hk/wiki/Linux_Server if ur using Linux
Reply
#9

Oh Oh.

Error

Код:
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(19) : error 017: undefined symbol "CreateDynamicObject"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(20) : error 017: undefined symbol "CreateDynamicObject"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(21) : error 017: undefined symbol "CreateDynamicObject"
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(22) : error 017: undefined symbol "CreateDynamicObject"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Code

Код:
//MY MAP
    CreateDynamicObject(16098, 366.43, 2543.45, 20.40,   0.00, 0.00, 270.00);
	CreateDynamicObject(9241, 417.63, 2515.03, 15.70,   0.00, 0.00, 180.00);
	CreateDynamicObject(9241, 417.54, 2495.62, 15.70,   0.00, 0.00, 0.00);
	CreateDynamicObject(16375, 289.35, 2451.71, 18.00,   0.00, 0.00, 0.00);
	//MY MAP END
do i have to #include something else or use other type of code?(Raw or only CreateObject)
Reply
#10

u need this Incognito's streamer to use CreateDyanmicObject download from here https://sampforum.blast.hk/showthread.php?tid=102865

EDIT: i forgot to tell that u have to put
Код:
#include streamer
at the top of ur script and before starting ur localhost server go to server.cfg and add this
Код:
Plugins streamer
Reply
#11

Tnx, trying localhost now.
Reply
#12

my gamemode returns absolutely no messages, only the 2 vehicles loaded. lol.... damn.

EDIT: Also cant connect to localhost

EDIT2: got message from print command. it works. but cant connect to localhost. ima try turning LANMODE to 1 in server CFG
Reply
#13

What do you mean you can't connect? Are you connecting to 127.0.0.1:7777? Is the samp_server.exe process still open?
Reply
#14

No, it closes. but it wont connect. lol
Reply
#15

Nvm. managed to connect and play. i think i can go on from here

Thanks for all help.
Reply
#16

Show us your server log please.

EDIT: Didn't see that u already solved your problem Delete this -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)