21.02.2013, 05:53
Guys,as i already asked you how I show a 3D Text to all Players in a vehicle,so i tried it.But when I get in vehicle it didnt show any label.Below is the onplayerstatechange and onplayerupdate.Check it and help me if u know
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid),Health);
new vspeed;
vspeed = GetVehicleSpeed(GetPlayerVehicleID(playerid));
if(IsPlayerInAnyVehicle(playerid))
{
if(HB[playerid] == 1 && Boost[playerid] == 1 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}%s's Car\nSpeed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\nHandbrake:Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 0 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 1 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 1 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 0 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 1 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 0 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 0 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(God[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "{FFFFFF}GOD MOD");
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
SetTimer("normal", 1000, true);
}
return 1;
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
Delete3DTextLabel(Speedo);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid),Health);
new vspeed;
vspeed = GetVehicleSpeed(GetPlayerVehicleID(playerid));
if(IsPlayerInAnyVehicle(playerid))
{
if(HB[playerid] == 1 && Boost[playerid] == 0 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 1 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\nHandbrake:Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 0 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 1 && Boost[playerid] == 1 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 1 && Lock[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Locked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 0 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:{FF0000}Offline\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(HB[playerid] == 0 && Boost[playerid] == 1 && Lock[playerid] == 0)
{
format(SpeedoStr, sizeof(SpeedoStr), "\n\n\n\n\n{05BDFA}Speed: %d km/hr%s\n{05BDFA}Health:[%s{05BDFA}]\nBoost:Online\n{05BDFA}Handbrake:{FF0000}De-Activated\n{05BDFA}Security:Unlocked\nUse /vehctrl", vspeed,UpdateLabelOfSpeed(playerid),UpdateString(playerid));
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
}
if(God[playerid] == 1)
{
format(SpeedoStr, sizeof(SpeedoStr), "{FFFFFF}GOD MOD");
Update3DTextLabelText(Speedo,0xFF0000FF,SpeedoStr);
SetTimer("normal", 1000, true);
}
return 1;
}
return 1;
}