Opis Problema: textdaw mi se ne pokazuje evo to je fs glad i wc
/*
Namjestiti:
Kada igrac kupi hranu GiveGlad(playerid, glad);
Kada ide na wc: GiveWC(playerid, wc);
*/
#include
#define STARTING_GLAD 75
#define STARTING_WC 75
forward GladWCCheck(); // Funkcija koja igracim askida 1 glad i 1 wc
new PlayerText:GladWCText;
public OnGameModeInit() {
SetTimer("GladWCCheck", 60000, 1); //Namjetmao timer za svakih minutu da skida igracima po 1 glad i wc
AddPlayerClass(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
return 1; }
public OnPlayerConnect(playerid) {
SetPVarInt(playerid, "glad", STARTING_GLAD); // Govori igraecvu glad
SetPVarInt(playerid, "wc", STARTING_WC); // Govori igracev wc
SetPVarInt(playerid, "showinggw", 0); // Govori dali prikazuje text za glad i wc
//--------------------------------------------------
GladWCText = CreatePlayerTextDraw(playerid,497,100,"~g~Glad~w~: 100~n~~b~WC:~w~ 100");
PlayerTextDrawLetterSize(playerid,GladWCText,0.349999,1.600000);
PlayerTextDrawAlignment(playerid,GladWCText,0);
PlayerTextDrawBackgroundColor(playerid,GladWCText,0x000000FF);
PlayerTextDrawFont(playerid,GladWCText,2);
PlayerTextDrawUseBox(playerid,GladWCText,0);
PlayerTextDrawSetOutline(playerid,GladWCText,1);
PlayerTextDrawSetProportional(playerid,GladWCText,1);
PlayerTextDrawSetShadow(playerid,GladWCText,0);
//--------------------------------------------------
return 1; }
public OnPlayerSpawn(playerid) {
//Prikazujemo igracu wc/glad text ukoliko mu se ne prikazuje
if(GetPVarInt(playerid, "showinggw") == 0) {
SetPVarInt(playerid, "showinggw", 1);
UpdateGladWCText(playerid);
PlayerTextDrawShow(playerid, GladWCText); }
return 1; }
public GladWCCheck() {
for(new i=0;i if(IsPlayerConnected(i)) {
new Float:phealth; GetPlayerHealth(i, phealth);
GiveGlad(i, -1);
if(GetPVarInt(i, "glad") < 0) { SetPVarInt(i, "glad", 0); SetPlayerHealth(i, phealth-1); }
GiveWC(i, -1);
if(GetPVarInt(i, "wc") < 0) { SetPVarInt(i, "wc", 0); SetPlayerHealth(i, phealth-1); }
UpdateGladWCText(i); } }
return 1; }
stock GiveGlad(playerid, glad) {
SetPVarInt(playerid, "glad", GetPVarInt(playerid, "glad")+glad);
return 1; }
stock GiveWC(playerid, wc) {
SetPVarInt(playerid, "wc", GetPVarInt(playerid, "wc")+wc);
return 1; }
stock UpdateGladWCText(playerid) {
if(!IsPlayerConnected(playerid)) { return 1; }
new str;
format(str, sizeof(str), "~y~Glad~w~: %d~n~~y~WC:~w~ %d", GetPVarInt(playerid, "glad"), GetPVarInt(playerid, "wc"));
PlayerTextDrawSetString(playerid, GladWCText, str);
return 1; } Slika/Video:/
Nesto da dodate Pomoc
