11.06.2013, 00:14
it's not changeing number's
i have a textdraw for Fine, just go to fine 0, i just wanna it go under and under.
i have a textdraw for Fine, just go to fine 0, i just wanna it go under and under.
Код:
CheckPlayerSpeeding(playerid) { // Setup local variables new Name[24], Msg[128]; // Check if the player hasn't been caught speeding recently if (APlayerData[playerid][PlayerCaughtSpeeding] == 0) { // Loop through all speedcameras for (new CamID; CamID < MAX_CAMERAS; CamID++) { // Check if this camera has been created if (ACameras[CamID][CamSpeed] != 0) { // Check if the player is the driver of the vehicle if (GetPlayerVehicleSeat(playerid) == 0) { // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding) if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed]) { // Check if the player is near the camera if (IsPlayerInRangeOfPoint(playerid, 50.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ])) { // Prevent the player being caught multiple times by the same speed-camera APlayerData[playerid][PlayerCaughtSpeeding] = 20; // Increase the wanted-level of this player by 1 star SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1); // Let the player know he's been caught speeding new string[155]; format(string,sizeof(string),TXT_PlayerCaughtSpeeding,APlayerData[playerid][PlayerSpeed],ACameras[CamID][CamSpeed]); SendClientMessage(playerid, 0xFFFFFFFF, string); // Get the name of the player GetPlayerName(playerid, Name, sizeof(Name)); // Also inform all police players that this player is caught speeding TextDrawShowForPlayer(playerid, FINE); format(Msg, 128, "%s is caught speeding, pursue and fine him", Name); Police_SendMessage(Msg); } } } } } } else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again APlayerData[playerid][PlayerCaughtSpeeding]--; }
Код:
public OnGameModeInit() { FINE = TextDrawCreate(505.000000, 122.000000, "Fine:"); new string[128]; new cash; format(string,128,"Fine: $%d",cash); TextDrawSetString(FINE,string); //cash=200 TextDrawBackgroundColor(FINE, 255); TextDrawFont(FINE, 2); TextDrawLetterSize(FINE, 0.300000, 1.200000); TextDrawColor(FINE, -1); TextDrawSetOutline(FINE, 1); TextDrawSetProportional(FINE, 1); return 1; }