Texdraw -
elvinas02 - 28.11.2012
Код:
if( IsPlayerInAnyVehicle(playerid) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
new stringz[126],stringaz[16];
format ( stringz, sizeof( stringz ), "~h~~r~%d", GetPlayerSpeed(playerid));
TextDrawSetString( Spidometras1[playerid],stringz );
if(GetPlayerSpeed(playerid) > 99)
{
stringaz = " KM/H";
}
else
{
stringaz = "KM/H";
format ( stringz, sizeof( stringz ), "%s", stringaz);
TextDrawSetString( Spidometras6[playerid],stringz);
}
new
vehicleid = GetPlayerVehicleID( playerid ),
model = GetVehicleModel( vehicleid );
TextDrawShowForPlayer(playerid,Spidometras0);
TextDrawShowForPlayer(playerid,Spidometras1[playerid]);
TextDrawShowForPlayer(playerid,Spidometras2[playerid]);
TextDrawShowForPlayer(playerid,Spidometras3[playerid]);
TextDrawShowForPlayer(playerid,Spidometras4[playerid]);
TextDrawShowForPlayer(playerid,Spidometras5[playerid]);
TextDrawShowForPlayer(playerid,Spidometras6[playerid]);
new
stringaz1 [ 50 ],
stringaz2 [ 50 ],
stringaz3 [ 50 ],
stringaz4 [ 50 ];
if( model != 481 && model != 509 && model != 510)
{
format ( stringaz1, sizeof( stringaz1 ), "~h~~w~Modelis:~h~~r~ %s",VehicleNames[GetVehicleModel(vehicleid)-400]);
format ( stringaz2, sizeof( stringaz2 ), "~h~~w~Degalai: ~h~~r~%i ~h~~w~l",tInfo[vehicleid][Degalai]);
format ( stringaz3, sizeof( stringaz3 ), "~h~~w~Kuro t. ~h~~r~%s",tInfo[vehicleid][Degalai]);
format ( stringaz4, sizeof( stringaz4 ), "~h~~w~Rida: ~h~~r~%.2f ~h~~w~KM",tInfo[vehicleid][Degalai]);
TextDrawSetString( Spidometras3[playerid],stringaz1 );
TextDrawSetString( Spidometras4[playerid],stringaz2 );
TextDrawSetString( Spidometras5[playerid],stringaz3 );
TextDrawSetString( Spidometras6[playerid],stringaz4 );
}
else
{
format ( stringaz1, sizeof( stringaz1 ), "~h~~w~Modelis:~h~~r~ %s",VehicleNames[GetVehicleModel(vehicleid)-400] );
format ( stringaz2, sizeof( stringaz2 ), "~h~~w~Degalai: ~h~~r~Nera");
format ( stringaz3, sizeof( stringaz3 ), "~h~~w~Kuro t. ~h~~r~Nera" );
format ( stringaz4, sizeof( stringaz4 ), "~h~~w~Rida: ~h~~r~Nera");
TextDrawSetString( Spidometras3[playerid],stringaz1 );
TextDrawSetString( Spidometras4[playerid],stringaz2 );
TextDrawSetString( Spidometras5[playerid],stringaz3 );
TextDrawSetString( Spidometras6[playerid],stringaz4 );
}
}
else
{
TextDrawHideForPlayer(playerid, Spidometras0);
TextDrawHideForPlayer(playerid, Spidometras1[playerid]);//5
TextDrawHideForPlayer(playerid, Spidometras2[playerid]);//6
TextDrawHideForPlayer(playerid, Spidometras3[playerid]);//7
TextDrawHideForPlayer(playerid, Spidometras4[playerid]);//8
TextDrawHideForPlayer(playerid, Spidometras5[playerid]);//9
TextDrawHideForPlayer(playerid, Spidometras6[playerid]);//10
}
Код:
Spidometras0 = TextDrawCreate(399.000000, 397.000000, "Fonas");
TextDrawBackgroundColor(Spidometras0, 255);
TextDrawFont(Spidometras0, 1);
TextDrawLetterSize(Spidometras0, 0.500000, 5.099999);
TextDrawColor(Spidometras0, -1);
TextDrawSetOutline(Spidometras0, 0);
TextDrawSetProportional(Spidometras0, 1);
TextDrawSetShadow(Spidometras0, 1);
TextDrawUseBox(Spidometras0, 1);
TextDrawBoxColor(Spidometras0, 120);
TextDrawTextSize(Spidometras0, 241.000000, 0.000000);
Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
Spidometras1[i] = TextDrawCreate(252.000000, 411.000000, "~h~~r~100");
TextDrawBackgroundColor(Spidometras1[i], 50);
TextDrawFont(Spidometras1[i], 3);
TextDrawLetterSize(Spidometras1[i], 0.440000, 2.300000);
TextDrawColor(Spidometras1[i], -1);
TextDrawSetOutline(Spidometras1[i], 1);
TextDrawSetProportional(Spidometras1[i], 1);
Spidometras2[i] = TextDrawCreate(318.000000, 401.000000, "~h~~w~Modelis:~h~~r~ Infernus");
TextDrawBackgroundColor(Spidometras2[i], 50);
TextDrawFont(Spidometras2[i], 2);
TextDrawLetterSize(Spidometras2[i], 0.160000, 0.900000);
TextDrawColor(Spidometras2[i], -1);
TextDrawSetOutline(Spidometras2[i], 1);
TextDrawSetProportional(Spidometras2[i], 1);
Spidometras3[i] = TextDrawCreate(318.000000, 411.000000, "~h~~w~Degalai: ~h~~r~Nera");
TextDrawBackgroundColor(Spidometras3[i], 50);
TextDrawFont(Spidometras3[i], 2);
TextDrawLetterSize(Spidometras3[i], 0.160000, 0.900000);
TextDrawColor(Spidometras3[i], -1);
TextDrawSetOutline(Spidometras3[i], 1);
TextDrawSetProportional(Spidometras3[i], 1);
Spidometras4[i] = TextDrawCreate(318.000000, 421.000000, "~h~~w~Kuro t. ~h~~r~Nera");
TextDrawBackgroundColor(Spidometras4[i], 50);
TextDrawFont(Spidometras4[i], 2);
TextDrawLetterSize(Spidometras4[i], 0.160000, 0.900000);
TextDrawColor(Spidometras4[i], -1);
TextDrawSetOutline(Spidometras4[i], 1);
TextDrawSetProportional(Spidometras4[i], 1);
Spidometras5[i] = TextDrawCreate(318.000000, 431.000000, "~h~~w~Rida: ~h~~r~Nera");
TextDrawBackgroundColor(Spidometras5[i], 50);
TextDrawFont(Spidometras5[i], 2);
TextDrawLetterSize(Spidometras5[i], 0.160000, 0.900000);
TextDrawColor(Spidometras5[i], -1);
TextDrawSetOutline(Spidometras5[i], 1);
TextDrawSetProportional(Spidometras5[i], 1);
Spidometras6[i] = TextDrawCreate(274.000000, 423.000000, "KM/H");
TextDrawBackgroundColor(Spidometras6[i], 255);
TextDrawFont(Spidometras6[i], 1);
TextDrawLetterSize(Spidometras6[i], 0.190000, 0.799999);
TextDrawColor(Spidometras6[i], -1);
TextDrawSetOutline(Spidometras6[i], 0);
TextDrawSetProportional(Spidometras6[i], 1);
TextDrawSetShadow(Spidometras6[i], 1);
}
What's wrong? Me wrote two texts.
~h~~w~Modelis:~h~~r~ Infernus and ~h~~w~Modelis:~h~~r~ %s
and etc...