OnPlayerRequestClass
#1

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

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;
}
Reply
#3

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

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

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)