SA-MP Forums Archive
Selecting a class, help please. - 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)
+--- Thread: Selecting a class, help please. (/showthread.php?tid=413307)



Selecting a class, help please. - JonesyFoCoTDM - 04.02.2013

Hi there, thought I would give scripting another go. I'm trying to change it so I can have multiple classes, but as you can see, it's not going to well. Any help will be appreciated, thanks in advance.

Код:
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(230,2301.2759,-1639.2301,14.6466,187.0401,24,500,31,1500,0,0);
	AddStaticVehicle(402,2296.8960,-1639.5154,14.5801,212.5119,13,13);
	AddPlayerClass(230,2127.3230,-1911.6631,13.5469,23.2084,24,500,31,1500,0,0);
	AddStaticVehicle(402,2133.6509,-1910.0625,13.2939,0.4945,13,13);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 2301.2759,-1639.2301,14.6466,187.0401);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerPos(playerid, 2127.3230,-1911.6631,13.5469,23.2084);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

These are the two errors I get when trying to compile it.

Код:
C:\Users\Lee\Desktop\SA-MP scripting\gamemodes\Jonesy.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Lee\Desktop\SA-MP scripting\gamemodes\Jonesy.pwn(54) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: Selecting a class, help please. - a.z.a.r - 04.02.2013

tell the number 51 and 54 where are these lines?


Re: Selecting a class, help please. - spedico - 04.02.2013

SetPlayerPos(playerid, 2301.2759,-1639.2301,14.6466);
SetPlayerPos(playerid, 2127.3230,-1911.6631,13.5469);

You had too many parameters on those lines. But that code won't work. You don't need to write the OnPlayerRequestClass code twice if you want multiple classes, just add AddPlayerClass(..) multiple times.


Re : Selecting a class, help please. - yusei - 04.02.2013

delete plz..


Re: Selecting a class, help please. - a.z.a.r - 04.02.2013

you mean Cases...

like... not sure though.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        CASE 0;
        {
    SetPlayerPos(playerid, 2301.2759,-1639.2301,14.6466,187.0401);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
        }
       
        CASE 1;
        {
    SetPlayerPos(playerid, 2127.3230,-1911.6631,13.5469,23.2084);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
        {
    return 1;
}
i dont script tdm no more... see if this works your welcome...
theres also a tutorial here
https://sampforum.blast.hk/showthread.php?tid=339571
and set the spaces... or it will give error... pm me for help


Re: Selecting a class, help please. - JonesyFoCoTDM - 04.02.2013

Thank you.