SA-MP Forums Archive
OnPlayerRequestClass - 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: OnPlayerRequestClass (/showthread.php?tid=429841)



OnPlayerRequestClass - zClaw - 11.04.2013

Hi, I am making a gamemode and I have 2 teams defined. Now I got this problem:

pawn Код:
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend.pwn(110 -- 111) : error 029: invalid expression, assumed zero
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend.pwn(116 -- 117) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Code:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0
        {
            SetPlayerTeam(playerid, Attackers);
            GameTextForPlayer(playerid, "~r~Attackers", 1000, 3);
         }
         
        case 1
        {
            SetPlayerTeam(playerid, Defenders);
            GameTextForPlayer(playerid, "~b~Defenders", 1000, 3);
         }
    }
    return 1;
}
I actually tried everything, but it doesnt seem to work.


Re: OnPlayerRequestClass - SilverKiller - 11.04.2013

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
            SetPlayerTeam(playerid, Attackers);
            GameTextForPlayer(playerid, "~r~Attackers", 1000, 3);
        }
        case 1:
        {
            SetPlayerTeam(playerid, Defenders);
            GameTextForPlayer(playerid, "~b~Defenders", 1000, 3);
        }
    }
    return 1;
}



Re: OnPlayerRequestClass - zClaw - 11.04.2013

2 questions, I have 2 teams but when I chose one of them they spawn at the same place. How can I change that?

The other one, I want the player to see the skin he can chose from, every team has his own skins. How can I change the camera positions to each headquarter.

Example: Team cops spawns at LSPD. Criminals spawns at Idlewood Gas Station. The camera has to move to Gas Station when I want to be a criminal. If I change my mind and want to become a cop it has to change back to the LSPD. How can I do that?


Re: OnPlayerRequestClass - SilverKiller - 11.04.2013

1:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPlayerTeam(playerid) == Attackers) SetPlayerPos(playerid, x, y, z);
    if(GetPlayerTeam(playerid) == Defenders) SetPlayerPos(playerid, x, y, z);
    return 1;
}
2: Use InteroplateCameraPos/LookAt.


Re: OnPlayerRequestClass - zClaw - 11.04.2013

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
1:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPlayerTeam(playerid) == Attackers) SetPlayerPos(playerid, x, y, z);
    if(GetPlayerTeam(playerid) == Defenders) SetPlayerPos(playerid, x, y, z);
    return 1;
}
2: Use InteroplateCameraPos/LookAt.
Appreciated. Thank you!