Help a beginner 2 Pawno.
#1

Hello guys, I'm having this issue with my script and I can't figure out what is wrong, I'm new to Pawno so perhaps I'm just blind. I was following a TuT without any explenations, this is how it turned out.


Output:
Код:
SA-MP\gamemodes\Project.pwn(87) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(87) : error 004: function "OnPlayerConnect" is not implemented
SA-MP\gamemodes\Project.pwn(92) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(92) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(92) : error 004: function "OnPlayerDisconnect" is not implemented
SA-MP\gamemodes\Project.pwn(97) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(97) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(97) : error 004: function "OnPlayerSpawn" is not implemented
SA-MP\gamemodes\Project.pwn(102) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(102) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(102) : error 004: function "OnPlayerDeath" is not implemented
SA-MP\gamemodes\Project.pwn(107) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(107) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(107) : error 004: function "OnVehicleSpawn" is not implemented
SA-MP\gamemodes\Project.pwn(112) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(112) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(112) : error 004: function "OnVehicleDeath" is not implemented
SA-MP\gamemodes\Project.pwn(117) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(117) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(117) : error 004: function "OnPlayerText" is not implemented
SA-MP\gamemodes\Project.pwn(122) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(122) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(122) : error 004: function "OnPlayerCommandText" is not implemented
SA-MP\gamemodes\Project.pwn(124) : error 017: undefined symbol "cmdtext"
SA-MP\gamemodes\Project.pwn(132) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(132) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(132) : error 004: function "OnPlayerEnterVehicle" is not implemented
SA-MP\gamemodes\Project.pwn(137) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(137) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(137) : error 004: function "OnPlayerExitVehicle" is not implemented
SA-MP\gamemodes\Project.pwn(142) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(142) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(142) : error 004: function "OnPlayerStateChange" is not implemented
SA-MP\gamemodes\Project.pwn(147) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(147) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\Project.pwn(147) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
SA-MP\gamemodes\Project.pwn(152) : warning 225: unreachable code
SA-MP\gamemodes\Project.pwn(152) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
EDIT: It doesn't seem to want to forward the 'forward' it's plain black text, not blue, sup with that?.
Script:
Код:
forward SetPlayerTeamFromClass(playerid, classid);
   public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0)
	{
	    gTeam[playerid] = BALLAS;
	    GameTextForPlayer(playerid,"~W~BALLAS",3000,5); // TEXT
	    SetPlayerPos(playerid,1975.2899,-1220.0157,25.0779); // POS OF PLAYER
		SetPlayerCameraPos(playerid,1959.5686,-1224.0016,24.9909); // CAMERA VIEW
		SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779); // FACE
		SetPlayerFacingAngle(playerid,122.4500);
		SetPlayerColor(playerid,0xA000FFFF); //TEAM COLOR
	}
else if(classid == 1)
	{
		gTeam[playerid] = GROVES;
		GameTextForPlayer(playerid,"~W~GROVE",3000,5);
		SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
		SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
		SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
		SetPlayerFacingAngle(playerid,252.4717);
		SetPlayerColor(playerid,0x55FF00FF);
    	SetPlayerTeamFromClass(playerid, classid);
    }
    return 1;
}
public SetPlayerTeamFromClass(playerid, classid)
{
What's my Error?

Tyvrm.
Reply
#2

Show the lines before, or show the line 87, 92, and so on..
Reply
#3

Alright,
Here are the lines from 1 to 55.
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0

#define BALLAS 0 // BALLA GANG
#define GROVES 1 // GROVE GANG
#define VATOS  2 // VATOS GANG
#define RIFA   3 // RIFA GANG
#define MAFFIA 4 // MAFIA GANG
#define COPS   5 // COPS FILTHY
#define CIVIL  6 // CIVIL INNOCENT

new gTeam[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("     blank#       ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}



main()
{
	print("\n----------------------------------");
	print("    blank#    ");
	print("----------------------------------\n");
}


public OnGameModeInit()
{
	SetGameModeText("blank");
	// Ballas
	AddPlayerClass(104,1979.1917,-1222.0964,25.1824,97.3597,0,0,0,0,0,0); // 104=Skin , 1979.1917 =X ect....
	// Groves
	AddPlayerClass(107,2508.5671,-1673.6665,13.3793,86.2585,0,0,0,0,0,0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

here are the lines from 84 to the end of it.
Код:
public SetPlayerTeamFromClass(playerid, classid)
{

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;
}
Between 55 and 84 is the script
Reply
#4

pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
{

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;
}
Should be
pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
{
        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;
}
Its causes because missing brackets on SetPlayerTeamFromClass.
Reply
#5

Thank you! I'm blind, obviously, lawl.
Reply
#6

Bumped into a new one, trying to use a Random message script, trying to make it work within gamemode, this is what I get:

Output:
Код:
SA-MP\gamemodes\ODTGM.pwn(393) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\ODTGM.pwn(393) : warning 215: expression has no effect
SA-MP\gamemodes\ODTGM.pwn(393) : error 001: expected token: ";", but found ")"
SA-MP\gamemodes\ODTGM.pwn(393) : error 029: invalid expression, assumed zero
SA-MP\gamemodes\ODTGM.pwn(393) : fatal error 107: too many error messages on one line

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


4 Errors.
Script:
Код:
public RandomMessage()
{
        new randomMsg = random(sizeof(randomMessages));
    	SendClientMessageToAll(BLANC, randomMessages[randomMsg]);
        return 1;
}
Reply
#7

Another one, I've added 3 Gangs on the server and each one works perfectly but all of them have just 1 character each. If I want to add 2 or 6 more characters, what do I need to do ?

I've tried the obvious noob with:
Код:
AddPlayerClass(293,482.7248,-1499.0201,20.3040,264.4212,26,300,31,1200,28,900); // <-- Works
AddPlayerClass(81,482.7248,-1499.0201,20.3040,264.4212,26,300,31,1200,28,900); // <-- Not Working
Script:
Код:
public OnGameModeInit()
{
    DisableInteriorEnterExits();
	UsePlayerPedAnims();
	SetGameModeText("ODT# *CnR © [.3z]");
	// Ballas
	AddPlayerClass(104,2038.7815,-1196.7813,22.8615,78.7513,26,300,30,1800,28,900); //

	// Groves
	AddPlayerClass(107,2508.5671,-1673.6665,13.3793,86.2585,26,300,30,1800,28,900); //

	// Vatos_Piskas
	AddPlayerClass(293,482.7248,-1499.0201,20.3040,264.4212,26,300,31,1200,28,900); //
	AddPlayerClass(81,482.7248,-1499.0201,20.3040,264.4212,26,300,31,1200,28,900); //
Код:
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0)
	{
	    gTeam[playerid] = BALLAS;
	    GameTextForPlayer(playerid,"~W~BALLAS",3000,5); // TEXT
	    SetPlayerPos(playerid, 1975.2899,-1220.0157,25.0779); // POS OF PLAYER
		SetPlayerCameraPos(playerid, 1959.5686,-1224.0016,24.9909); // CAMERA VIEW
		SetPlayerCameraLookAt(playerid, 1975.2399,-1220.0157,25.0779); // FACE
		SetPlayerFacingAngle(playerid, 122.4500);
		SetPlayerColor(playerid, 0xA000FFFF); //TEAM COLOR
	}
else if(classid == 1)
	{
		gTeam[playerid] = GROVES;
		GameTextForPlayer(playerid,"~W~GROVE",3000,5);
		SetPlayerPos(playerid, 2500.6060,-1672.1453,13.3512);
		SetPlayerCameraPos(playerid, 2507.0615,-1674.3574,13.3732);
		SetPlayerCameraLookAt(playerid, 2500.6060,-1672.1453,13.3512);
		SetPlayerFacingAngle(playerid, 252.4717);
		SetPlayerColor(playerid, 0x55FF00FF);
    }
else if(classid == 2)
	{
		gTeam[playerid] = Vatos_Piskas;
		GameTextForPlayer(playerid,"~W~Vatos Piskas",3000,5);
		SetPlayerPos(playerid, 482.7248,-1499.0201,20.3040);
		SetPlayerCameraPos(playerid, 488.3776,-1499.1854,20.2850);
		SetPlayerCameraLookAt(playerid, 482.7248,-1499.0201,20.3040);
		SetPlayerFacingAngle(playerid, 252.4717);
		SetPlayerColor(playerid, 0x55FF00FF);
    }
return 1;
}
Reply
#8

Above problems are solved by removing them. Now, I'd like to know How-To or Simply share me a link to where I can learn how to create 3 - 5 Teams with each team having more then 5 - 10 classes to choose from. MUCH Appreciated.

I've tried using Search function but it tells me that there's no results matching my search, so please, if you don't mind!.

++Rep for this!.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)