Skill Change don't work
#1

Who does this not work?

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    new Score = GetPlayerScore(playerid);
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
    {
        if(Score < 11) return GameTextForPlayer(playerid, "~b~You need atleast~n~~g~10 ~b~score to join this skill", 3000, 5);
        {
            gTeam[playerid] = TEAM_DONUTSTEALRT;
            return 1;
        }
    }
    return 0;
}
Reply
#2

You are using if statements wrong.

pawn Код:
if(Score < 11)
    return GameTextForPlayer(playerid, "~b~You need atleast~n~~g~10 ~b~score to join this skill", 3000, 5);
else
{
    gTeam[playerid] = TEAM_DONUTSTEALRT;
    return 1;
}
Reply
#3

Wierd, it still dont work
Reply
#4

Maybe this will give you something to work with? Not sure if it really help

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(!IsPlayerNPC(playerid))
    {
        if(!PlayerInfo[playerid][Logged]) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You must login/register before spawning!"); return 0; }
        else if(PlayerInfo[playerid][c]==3 && PlayerInfo[playerid][NationalGuard]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into National Guard before spawning into it."); return 0; }
        else if(PlayerInfo[playerid][c]==2 && PlayerInfo[playerid][Swat]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into S.W.A.T before spawning into it."); return 0; }
        else
        {
            PlayerInfo[playerid][Team] = PlayerInfo[playerid][c];
            switch(PlayerInfo[playerid][Team])
            {
                case 0,1: //police + cia
                {
                    SetPlayerColor(playerid, COLOR_BLUE);
                    if(PlayerInfo[playerid][Team] == 1) SetPlayerColor(playerid, COLOR_WHITE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1526.1906,-1677.9984,5.8906,267.8484, 24, 200, 29, 150, 25, 20);
                    SetPlayerPos(playerid, 1526.1906,-1677.9984,5.8906);
                    GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 25, 200);
                }
                case 2: //swat
                {
                    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 759.4473,-1363.1069,13.5181,265.0181, 24, 200, 31, 250, 27, 50);
                    SetPlayerPos(playerid, 759.4473,-1363.1069,13.5181);
                    GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 50);
                }
                case 3: //national guard
                {
                    SetPlayerColor(playerid, COLOR_PURPLE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 2749.4026,-2447.4622,13.6484,357.4269, 29, 200, 31, 250, 27, 80);
                    SetPlayerPos(playerid, 2749.4026,-2447.4622,13.6484);
                    GivePlayerWeapon(playerid, 29, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 80);
                }
                case 4: //ems / fd
                {
                    SetPlayerColor(playerid, COLOR_DARKGREEN);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1185.4379,-1323.6609,13.5721,262.1728, 23, 200, 0, 0, 0, 0);
                    SetPlayerPos(playerid, 1185.4379,-1323.6609,13.5721);
                    GivePlayerWeapon(playerid, 23, 200);
                }
                case 5: //civ
                {
                    SetPlayerColor(playerid, COLOR_WHITE);
                    SetPlayerTeam(playerid, playerid+10);
                }
            }
        }
    }
    return 1;
}
Reply
#5

No didnt help. My skill...W/E is set up like this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid,1206.9768,-32.5926,1000.9531);
    SetPlayerFacingAngle(playerid,249.3010);
    SetPlayerCameraPos(playerid,1209.1083,-33.8061,1000.9531);
    SetPlayerCameraLookAt(playerid,1206.9768,-32.5926,1000.9531);

    switch (classid)
    {
        case 0, 1, 2, 3, 4:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 5:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 6:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 7:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 8:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 9:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 10:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
        case 11:
        {
            GameTextForPlayer(playerid, "something", 3000, 5);
        }
    }
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
   
    else if(classid == 5 || classid == 6)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }

    else if(classid == 7)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
   
    else if(classid == 8)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
   
    else if(classid == 9)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
   
    else if(classid == 10)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
   
    else if(classid == 11)
    {
        gTeam[playerid] = TEAM_SOMETHING;
        return 1;
    }
    return 0;
}

...OnPlayerSpawn
{
    if(gTeam[playerid... = something])
    {
         SeatPlayerColor(...)
    }
    else if(gteam...........)
    .....
}
Reply
#6

This is how it is on my gamemode

Did you already define your teams?

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    PlayerPlaySound(playerid, 1183, 0.0, 0.0, 0.0);
    SetPlayerCameraPos(playerid,1811.8379,-1602.5963,13.5313);
    SetPlayerCameraLookAt(playerid,1808.8795,-1599.4998,13.5469);
    SetPlayerPos(playerid, 1809.1266,-1599.5068,13.5469);
    SetPlayerFacingAngle(playerid, 222.6137);
    ApplyAnimation(playerid,"PARK","Tai_Chi_Loop", 3.1,1,1,1,1,1);
    ApplyAnimation(playerid,"PARK","Tai_Chi_Loop", 3.1,1,1,1,1,1);
    ApplyAnimation(playerid,"PARK","Tai_Chi_Loop", 3.1,1,1,1,1,1);
    ApplyAnimation(playerid,"PARK","Tai_Chi_Loop", 3.1,1,1,1,1,1);
    switch(classid)
    {
        case 0..8:{     GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~b~      Police", 3000, 3); PlayerInfo[playerid][c]=0; }
        case 9,10:{     GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~b~      CIA", 3000, 3); PlayerInfo[playerid][c]=1; }
        case 11:{       GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~b~~h~~h~      S.W.A.T~n~~w~      Invite Required", 3000, 3); PlayerInfo[playerid][c]=2; }
        case 12:{       GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~p~      National Guard~n~~w~      Invite Required", 3000, 3); PlayerInfo[playerid][c]=3; }
        case 13..16:{   GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~g~      Emergency Responders", 3000, 3); PlayerInfo[playerid][c]=4; }
        case 17..104:{  GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~w~      Civilian", 3000, 3); PlayerInfo[playerid][c]=5; }
    }
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(!IsPlayerNPC(playerid))
    {
        if(!PlayerInfo[playerid][Logged]) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You must login/register before spawning!"); return 0; }
        else if(PlayerInfo[playerid][c]==3 && PlayerInfo[playerid][NationalGuard]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into National Guard before spawning into it."); return 0; }
        else if(PlayerInfo[playerid][c]==2 && PlayerInfo[playerid][Swat]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into S.W.A.T before spawning into it."); return 0; }
        else
        {
            PlayerInfo[playerid][Team] = PlayerInfo[playerid][c];
            switch(PlayerInfo[playerid][Team])
            {
                case 0,1: //police + cia
                {
                    SetPlayerColor(playerid, COLOR_BLUE);
                    if(PlayerInfo[playerid][Team] == 1) SetPlayerColor(playerid, COLOR_WHITE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1526.1906,-1677.9984,5.8906,267.8484, 24, 200, 29, 150, 25, 20);
                    SetPlayerPos(playerid, 1526.1906,-1677.9984,5.8906);
                    GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 25, 200);
                }
                case 2: //swat
                {
                    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 759.4473,-1363.1069,13.5181,265.0181, 24, 200, 31, 250, 27, 50);
                    SetPlayerPos(playerid, 759.4473,-1363.1069,13.5181);
                    GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 50);
                }
                case 3: //national guard
                {
                    SetPlayerColor(playerid, COLOR_PURPLE);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 2749.4026,-2447.4622,13.6484,357.4269, 29, 200, 31, 250, 27, 80);
                    SetPlayerPos(playerid, 2749.4026,-2447.4622,13.6484);
                    GivePlayerWeapon(playerid, 29, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 80);
                }
                case 4: //ems / fd
                {
                    SetPlayerColor(playerid, COLOR_DARKGREEN);
                    SetPlayerTeam(playerid, TEAM_POLICE);
                    //SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1185.4379,-1323.6609,13.5721,262.1728, 23, 200, 0, 0, 0, 0);
                    SetPlayerPos(playerid, 1185.4379,-1323.6609,13.5721);
                    GivePlayerWeapon(playerid, 23, 200);
                }
                case 5: //civ
                {
                    SetPlayerColor(playerid, COLOR_WHITE);
                    SetPlayerTeam(playerid, playerid+10);
                }
            }
        }
    }
    return 1;
}
Reply
#7

Yes, my teams is defined, but i still dont get it to work
Reply
#8

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    new Score = GetPlayerScore(playerid);
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
    {
        if(Score < 11) { GameTextForPlayer(playerid, "~b~You need atleast~n~~g~10 ~b~score to join this skill", 3000, 5); }
        else
        }
            gTeam[playerid] = TEAM_DONUTSTEALRT;
            return 1;
        }
}
Reply
#9

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    new Score = GetPlayerScore(playerid);
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
    {
        if(Score < 11)
        {
            GameTextForPlayer(playerid, "~b~You need atleast~n~~g~10 ~b~score to join this skill", 3000, 5);
        }
        else
        {
            gTeam[playerid] = TEAM_DONUTSTEALRT;
        }
     }
     return 1;

}
Reply
#10

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    new Score = GetPlayerScore(playerid);
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
    {
        if(Score < 11)
        {
            GameTextForPlayer(playerid, "~b~You need atleast~n~~g~10 ~b~score to join this skill", 3000, 5);
        }
        else
        {
            gTeam[playerid] = TEAM_DONUTSTEALRT;
        }
     }
     return 1;

}
Already tried....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)