SA-MP Forums Archive
RequestClass - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: RequestClass (/showthread.php?tid=149573)



RequestClass - billiout - 22.05.2010

hi, i have a problem with the class selection when i spawn i have this



this is the code

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript

#include <a_samp>



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



public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");

  AddPlayerClass(280, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);

  AddPlayerClass(281, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);

  AddPlayerClass(282, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);

  AddPlayerClass(283, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);

  AddPlayerClass(284, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}

public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

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;
}
pls help


Re: RequestClass - ViruZZzZ_ChiLLL - 22.05.2010

Maybe, its because of the SetPlayerInterior?

pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 0);
return 1;
}
It's because of this :
pawn Код:
public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14); // here ^^
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}



Re: RequestClass - iJumbo - 22.05.2010

put this :SetPlayerInterior(playerid,0);
under onplayerspawn
example

Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
	return 1;
}



Re: RequestClass - billiout - 22.05.2010

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Maybe, its because of the SetPlayerInterior?

pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 0);
return 1;
}
thanks it worked. sry for the noob problem but its my first time i try to make a gamemode. thanks again.


Re: RequestClass - billiout - 22.05.2010

new problem

i add the the cop team with gteam and i have this problem



the skins didnt show up. the code is

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript

#include <a_samp>

#define TEAM_COP 1
#define TEAM_ARMY 2

new KilledHimself[MAX_PLAYERS];
new time[2];
new Text:txtTimeDisp;
new gTeam[MAX_PLAYERS];

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



public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
  SetWorldTime(12);
  EnableTirePopping(1);
  AllowInteriorWeapons(1);
  AllowAdminTeleport(1);
  time[0] = random(24), time[1] = random(60);
  SetTimer("ChangeTime", 1000, true);
  txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
  TextDrawUseBox(txtTimeDisp, 0);
	TextDrawFont(txtTimeDisp, 3);
	TextDrawSetShadow(txtTimeDisp,0); // no shadow
	TextDrawSetOutline(txtTimeDisp,2); // thickness 1
	TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
	TextDrawColor(txtTimeDisp,0xFFFFFFFF);
	TextDrawAlignment(txtTimeDisp,3);
	TextDrawLetterSize(txtTimeDisp,0.5,1.5);


  AddPlayerClass(280, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
  AddPlayerClass(281, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
	AddPlayerClass(282, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
  AddPlayerClass(283, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
	AddPlayerClass(284, 1564.994140, -1694.396118, 5.890625, 185.373443, 22, 1437, 0, 0, 0, 0);
	
  AddStaticVehicle(596, 1558.6680, -1710.2739, 5.6111, 180.0121, 0, 1);
  AddStaticVehicle(523, 1578.8756, -1709.3790, 5.4575, 180.2144, 0, 1);


	return 1;
}

forward ChangeTime();
public ChangeTime()
{
  new
    string[6];

  time[1] ++;
  if(time[1] > 59) time[1] = 0, time[0] ++;
  if(time[0] > 23) time[0] = 0, time[1] = 0;
  format(string, sizeof(string), "%02d:%02d", time[0], time[1]);
  TextDrawSetString(txtTimeDisp, string);
  for(new i = 0; i < MAX_PLAYERS; i ++)
  {
    if(IsPlayerConnected(i)) SetPlayerTime(i, time[0], time[1]);
  }
  return 1;
}

SetPlayerTeamFromClass(playerid, classid) {

 if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5) { //these are the class id's

gTeam[playerid] = TEAM_COP;

}
public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}

public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

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

public OnPlayerDeath(playerid, killerid, reason)
{
  TextDrawHideForPlayer(playerid,txtTimeDisp);
	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("/kill", cmdtext, true, 10) == 0)
	{
		KilledHimself[playerid] =1;
		//GetPlayerName(playerid, str, 24);
    //format(str, 100, "%s(%d) Has commited suicide using /kill", str,playerid);
    //SendClientMessageToAll(0xEE82EEAA, str);
    SetPlayerHealth(playerid,0);
		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;
}
if i put this on OnPlayerRequestClass

SetPlayerTeamFromClass(playerid, classid);

i have this errors

Код:
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(82) : warning 217: loose indentation
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(82) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(82) : error 004: function "OnGameModeExit" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(87) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(87) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(87) : error 004: function "OnPlayerRequestClass" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(90) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(94) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(94) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(94) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(103) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(103) : error 004: function "OnPlayerConnect" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(108) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(108) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(108) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(113) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(113) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(113) : error 004: function "OnPlayerSpawn" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(120) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(120) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(120) : error 004: function "OnPlayerDeath" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(126) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(126) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(126) : error 004: function "OnVehicleSpawn" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(131) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(131) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(131) : error 004: function "OnVehicleDeath" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(136) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(136) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(136) : error 004: function "OnPlayerText" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(141) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(141) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(141) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(143) : error 017: undefined symbol "cmdtext"
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(155) : warning 225: unreachable code
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(155) : error 029: invalid expression, assumed zero
C:\Users\Billys\Desktop\sa-mp\gamemodes\lscnr.pwn(155) : error 004: function "OnPlayerEnterVehicle" is not implemented

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


26 Errors.
pls help


Re: RequestClass - billiout - 23.05.2010

<BUMP> really need help