Selecting a class, help please.
#1

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.
Reply
#2

tell the number 51 and 54 where are these lines?
Reply
#3

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.
Reply
#4

delete plz..
Reply
#5

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
Reply
#6

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)