SetPlayerTeamFromClass(playerid, classid); doesnt work why
#1

Why doesnt this work:
Код:
SetPlayerTeamFromClass(playerid, classid);
Reply
#2

Could we see some code?
Reply
#3

pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Blank Script");
AddPlayerClass(105,2507.3433,-1667.9476,13.3786,87.4340,0,0,0,0,0,0); // GroveGangster
AddPlayerClass(106,2505.7571,-1661.7249,13.4050,104.9574,0,0,0,0,0,0); // GroveGangster
AddPlayerClass(107,2504.2400,-1676.7767,13.3718,63.2837,0,0,0,0,0,0); // GroveGangster
AddPlayerClass(102,2000.7134,-1118.9550,26.7813,184.3736,0,0,0,0,0,0); // BallasGangster
AddPlayerClass(103,1996.8842,-1119.0229,26.7737,194.7137,0,0,0,0,0,0); // BallasGangster
AddPlayerClass(104,2006.3639,-1119.8727,26.6915,177.4802,0,0,0,0,0,0); // BallasGangster
CreateVehicle(541, 2507.3433, -1667.9476, 13.3786, 87.4340, -1, -1, 1000000);




SetTimer("SaveStats",30000,true);
    return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
    Team[playerid] = classid;
        SetPlayerTeamFromClass(playerid, classid);
    SetPlayerPos(playerid, 1959.281860, -1177.373901, 27.491060);
    SetPlayerFacingAngle(playerid, 91.097679);
    SetPlayerCameraLookAt(playerid, 1959.281860, -1177.373901, 27.491060);
    SetPlayerCameraPos(playerid, 1959.281860 + (10 * floatsin(-91.097679, degrees)), -1177.373901 + (10 * floatcos(-91.097679, degrees)), 27.491060);
    return 1;
}
I dont see why you need to see my code it says that it isnt defined:
pawn Код:
C:\Users\mattt\Desktop\Deathmatch\gamemodes\Deathmatch.pwn(84) : error 017: undefined symbol "SetPlayerTeamFromClass"
Reply
#4

SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 105 || classid == 106 || classid == 107)
{
Team[playerid] = TEAM_GROVE;
}
else
{
Team[playerid] = TEAM_BALLAS;
}
}

Forgot this hahas
Reply
#5

pawn Код:
Team[playerid] = classid;
SetPlayerTeamFromClass(playerid, classid);
If you doing something.. make it sense..

pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Blank Script");
    AddPlayerClass(105,2507.3433,-1667.9476,13.3786,87.4340,0,0,0,0,0,0); // GroveGangster
    AddPlayerClass(106,2505.7571,-1661.7249,13.4050,104.9574,0,0,0,0,0,0); // GroveGangster
    AddPlayerClass(107,2504.2400,-1676.7767,13.3718,63.2837,0,0,0,0,0,0); // GroveGangster
    AddPlayerClass(102,2000.7134,-1118.9550,26.7813,184.3736,0,0,0,0,0,0); // BallasGangster
    AddPlayerClass(103,1996.8842,-1119.0229,26.7737,194.7137,0,0,0,0,0,0); // BallasGangster
    AddPlayerClass(104,2006.3639,-1119.8727,26.6915,177.4802,0,0,0,0,0,0); // BallasGangster
    CreateVehicle(541, 2507.3433, -1667.9476, 13.3786, 87.4340, -1, -1, 1000000);

    SetTimer("SaveStats",30000,true);
    return true;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    SetPlayerPos(playerid, 1959.281860, -1177.373901, 27.491060);
    SetPlayerFacingAngle(playerid, 91.097679);
    SetPlayerCameraLookAt(playerid, 1959.281860, -1177.373901, 27.491060);
    SetPlayerCameraPos(playerid, 1959.281860 + (10 * floatsin(-91.097679, degrees)), -1177.373901 + (10 * floatcos(-91.097679, degrees)), 27.491060);
    return true;
}

stock SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 105..107:Team[playerid] = TEAM_GROVE;
        case 102..104:Team[playerid] = TEAM_BALLAS;
    }
    return true;
}
P.S
I'll give you good advice.. use y_groups and y_classes.
Reply
#6

why what do y_Groups and yclasses do?
Reply
#7

classids aren't skinids...every AddPlayerClass adds 1 to it starting from 0.....

do new GROVE1, GROVE2, GROVE3; then do GROVE1 = AddPlayerClass blah blah

then SetPlayerTeamFromClass(playerid, classid)
if(classid == GROVE1 || classid == GROVE2 || classid == GROVE3) do some shit


pawn Код:
classid 0 is   AddPlayerClass(105,2507.3433,-1667.9476,13.3786,87.4340,0,0,0,0,0,0); // GroveGangster
classid 1 is   AddPlayerClass(106,2505.7571,-1661.7249,13.4050,104.9574,0,0,0,0,0,0); // GroveGangster
classid 2 is   AddPlayerClass(107,2504.2400,-1676.7767,13.3718,63.2837,0,0,0,0,0,0); // GroveGangster
classid 3 is   AddPlayerClass(102,2000.7134,-1118.9550,26.7813,184.3736,0,0,0,0,0,0); // BallasGangster
classid 4 is   AddPlayerClass(103,1996.8842,-1119.0229,26.7737,194.7137,0,0,0,0,0,0); // BallasGangster
classid 5 is   AddPlayerClass(104,2006.3639,-1119.8727,26.6915,177.4802,0,0,0,0,0,0); // BallasGangster
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)