03/12/2022 16:12
isso ai ta pegando o nome da profissão do npc desempregado e passando a string pro texto na cabeça dele
new Text3D:NPCLabel[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
if(IsPlayerNPC(playerid))
{
new string[256];
if(!dini_Exists(file)) // Criando conta para NPC's
{
WP_Hash(bufpass, sizeof(bufpass), SENHA_CONTA_NPC);
CreateFileAccount(file, bufpass);
}
if(!strcmp(szPlayerName, "Samanta_Oliveira", true))
{
format(string, sizeof(string), "%s (%d)", szPlayerName, playerid);
NPCLabel[playerid] = CreateDynamic3DTextLabel(string, -1, 0.0, 0.0, 0.0, 30.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 200.0);
dini_IntSet(file, "Profissao", 37);
SetPlayerSkin(playerid, dini_Int(file, "Skin"));
}
public Logarprof(playerid)
{
new string[256];
new nomepl[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomepl, sizeof(nomepl));
format(file2, sizeof(file2), PASTA_CONTAS, nomepl);
if(dini_Int(file2, "Profissao") == Desempregado)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 14, 1);
SetPlayerColor(playerid, Branco);
if(IsPlayerNPC(playerid))
{
if(IsValidDynamic3DTextLabel(NPCLabel[playerid]))
{
format(string, sizeof(string), "%s (%d)", nomepl, playerid);
UpdateDynamic3DTextLabelText(NPCLabel[playerid], Branco, string);
}
}
else
{
if(IsValidDynamic3DTextLabel(ProfLabel[playerid]))
{
UpdateDynamic3DTextLabelText(ProfLabel[playerid], Branco, "[Desempregado(a)]");
}
}
}
new Text3D:NPCLabel[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
if(IsPlayerNPC(playerid))
{
new string[256];
if(!dini_Exists(file)) // Criando conta para NPC's
{
WP_Hash(bufpass, sizeof(bufpass), SENHA_CONTA_NPC);
CreateFileAccount(file, bufpass);
}
if(!strcmp(szPlayerName, "Samanta_Oliveira", true))
{
format(string, sizeof(string), "%s (%d)", szPlayerName, playerid);
NPCLabel[playerid] = CreateDynamic3DTextLabel(string, -1, 0.0, 0.0, 0.0, 30.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 200.0);
dini_IntSet(file, "Profissao", 37);
SetPlayerSkin(playerid, dini_Int(file, "Skin"));
}
public Logarprof(playerid)
{
new string[256];
new nomepl[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomepl, sizeof(nomepl));
format(file2, sizeof(file2), PASTA_CONTAS, nomepl);
if(dini_Int(file2, "Profissao") == Desempregado)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 14, 1);
SetPlayerColor(playerid, Branco);
if(IsPlayerNPC(playerid))
{
if(IsValidDynamic3DTextLabel(NPCLabel[playerid]))
{
format(string, sizeof(string), "%s (%d)", nomepl, playerid);
UpdateDynamic3DTextLabelText(NPCLabel[playerid], Branco, string);
}
}
else
{
if(IsValidDynamic3DTextLabel(ProfLabel[playerid]))
{
UpdateDynamic3DTextLabelText(ProfLabel[playerid], Branco, "[Desempregado(a)]");
}
}
}