Eu queria colocar um sistema no GM que setasse uma Skin pra cada membro de um determinado cargo de uma organizaзгo:
Eu tentei adicionar o mesmo sistema que usei no /batercartгo pra setar as fardas na OnPlayerSpawn, chegou a compilar, funcionou uma ъnica vez e logo depois, parou.
Alguйm poderia me ajudar me passar um tutorial ou uma base pra fazer isso funcionar?
Isso tem que ser adicionado na OnPlayerSpawn? Porque eu adiciono, compila, mas na pratica, nгo seta a skin
pawn Code:
public OnPlayerSpawn(playerid)
{
if(sincronizando[playerid] == 1)
{
return 1;
}
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
if (gTeam[playerid] == 4) //medic / criminal reset team
{
gTeam[playerid] = 3;
}
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "AdmCmd: Vocк foi kickado por Chuck_Norris, Motivo: Spawn sem login");
SendClientMessage(playerid, COLOR_LIGHTRED,"Chuck_Norris te kickou do servidor, e nгo o contrarie novamente");
Kick(playerid);
return 1;
}
CheckInfoOrg(playerid);
if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLider] < 1)
{
MedicBill[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo foi aprovado pelo lнder, agora й um Civil !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 5)
{
if(PlayerInfo[playerid][pMembro] < 1)
{
MedicBill[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma familia, agora й um Civil !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 10)
{
if(PlayerInfo[playerid][pMembro] != 8)
{
MedicBill[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma agencia, й um Civil !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMembro] > 3)
{
MedicBill[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo й mais um oficial, й um Civil !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 3)
{
if(PlayerInfo[playerid][pMembro] > 0 || PlayerInfo[playerid][pLider] > 0)
{
MedicBill[playerid] = 0;
if(PlayerInfo[playerid][pMembro] == 1) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
else if(PlayerInfo[playerid][pMembro] == 2) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
else if(PlayerInfo[playerid][pMembro] == 3) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
else if(PlayerInfo[playerid][pMembro] == 4) { SetSpawnInfo(playerid, 1, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; }
else if(PlayerInfo[playerid][pMembro] == 5) { SetSpawnInfo(playerid, 5, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; }
else if(PlayerInfo[playerid][pMembro] == 6) { SetSpawnInfo(playerid, 5, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; }
else if(PlayerInfo[playerid][pMembro] == 8) { SetSpawnInfo(playerid, 10, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; }
else if(PlayerInfo[playerid][pMembro] == 9) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
else if(PlayerInfo[playerid][pMembro] == 10) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
else if(PlayerInfo[playerid][pMembro] == 11) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
else if(PlayerInfo[playerid][pMembro] == 12) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 22; }
else if(PlayerInfo[playerid][pMembro] == 13) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 20; }
else if(PlayerInfo[playerid][pMembro] == 14) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 15; }
else if(PlayerInfo[playerid][pMembro] == 15) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 16; }
else if(PlayerInfo[playerid][pMembro] == 16) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
else if(PlayerInfo[playerid][pMembro] == 17) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 18; }
else if(PlayerInfo[playerid][pMembro] == 18) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pMembro] == 19) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pMembro] == 20) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pMembro] == 21) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pLider] == 1) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 2) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 3) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 4) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 5) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 6) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 7) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 8) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 9) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 10) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 11) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
else if(PlayerInfo[playerid][pLider] == 12) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 22; }
else if(PlayerInfo[playerid][pLider] == 13) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 20; }
else if(PlayerInfo[playerid][pLider] == 14) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 15; }
else if(PlayerInfo[playerid][pLider] == 15) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 16; }
else if(PlayerInfo[playerid][pLider] == 16) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
else if(PlayerInfo[playerid][pLider] == 17) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 18; }
else if(PlayerInfo[playerid][pLider] == 18) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pLider] == 19) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pLider] == 20) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
else if(PlayerInfo[playerid][pLider] == 21) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
SpawnPlayer(playerid);
}
}
if(PlayerInfo[playerid][pSkin] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
else
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
else { PlayerInfo[playerid][pSkin] = 12; SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
}
SetPlayerWeapons(playerid);
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
PlayerFixRadio(playerid);
return 1;
}