SA-MP Forums Archive
Can someone help me?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can someone help me?? (/showthread.php?tid=613006)



Can someone help me?? - Micko123 - 23.07.2016

I created these stocks
PHP код:
stock Kreiraj_PTD(playeridbool:kreiran)
{
    if(
kreiran == true)
    {
//============================== Datum =========================================//
        
TDEditor_PTD[playerid][0] = CreatePlayerTextDraw(playerid552.66687016.275588"00/00/00");
        
PlayerTextDrawLetterSize(playeridTDEditor_PTD[playerid][0], 0.3000001.600000);
        
PlayerTextDrawAlignment(playeridTDEditor_PTD[playerid][0], 1);
        
PlayerTextDrawColor(playeridTDEditor_PTD[playerid][0], 16777215);
        
PlayerTextDrawSetShadow(playeridTDEditor_PTD[playerid][0], 0);
        
PlayerTextDrawSetOutline(playeridTDEditor_PTD[playerid][0], 0);
        
PlayerTextDrawBackgroundColor(playeridTDEditor_PTD[playerid][0], 255);
        
PlayerTextDrawFont(playeridTDEditor_PTD[playerid][0], 2);
        
PlayerTextDrawSetProportional(playeridTDEditor_PTD[playerid][0], 1);
        
PlayerTextDrawSetShadow(playeridTDEditor_PTD[playerid][0], 0);
//============================== Vrijeme =======================================//
        
TDEditor_PTD[playerid][1] = CreatePlayerTextDraw(playerid552.22229044.648906"00:00:00");
        
PlayerTextDrawLetterSize(playeridTDEditor_PTD[playerid][1], 0.4000001.600000);
        
PlayerTextDrawAlignment(playeridTDEditor_PTD[playerid][1], 1);
        
PlayerTextDrawColor(playeridTDEditor_PTD[playerid][1], 16777215);
        
PlayerTextDrawSetShadow(playeridTDEditor_PTD[playerid][1], 0);
        
PlayerTextDrawSetOutline(playeridTDEditor_PTD[playerid][1], 0);
        
PlayerTextDrawBackgroundColor(playeridTDEditor_PTD[playerid][1], 255);
        
PlayerTextDrawFont(playeridTDEditor_PTD[playerid][1], 2);
        
PlayerTextDrawSetProportional(playeridTDEditor_PTD[playerid][1], 1);
        
PlayerTextDrawSetShadow(playeridTDEditor_PTD[playerid][1], 0);
    }
    if(
kreiran == false)
    {
        
PlayerTextDrawDestroy(playeridTDEditor_PTD[playerid][0]);
            
PlayerTextDrawDestroy(playeridTDEditor_PTD[playerid][1]);
    }
    return 
1;

PHP код:
stock Prikazi_PTD(playerid)
{
    new 
datum[25], vrijeme[25], satminutsekunddanmjesecgodina;
    
gettime(satminutsekund);
    
getdate(godinamjesecdan);
    
format(datumsizeof datum"~w~%02d %02d %02d"danmjesecgodina);
    
PlayerTextDrawSetString(playeridTDEditor_PTD[playerid][0], datum);
    
format(vrijemesizeof vrijeme"~w~%02d %02d %02d"satminutsekund);
    
PlayerTextDrawSetString(playeridTDEditor_PTD[playerid][1], vrijeme);
    
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][0]);
    
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][1]);
    return 
1;

First one is for creating TexDraws and second one is for showing them. I also have this
PHP код:
public OnPlayerConnect(playerid)
{
    
Kreiraj_PTD(playeridtrue);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
Prikazi_PTD(playerid);
    return 
1;

But it won't show TextDraws. What can i do??


Re: Can someone help me?? - Sjn - 23.07.2016

Edit: Oh, sorry, I didn't notice you have another stock too.


Re: Can someone help me?? - Micko123 - 23.07.2016

Nope. Still won't show


Re: Can someone help me?? - Sjn - 23.07.2016

Код:
stock Prikazi_PTD(playerid) 
{ 
    new datum[25], vrijeme[25], sat, minut, sekund, dan, mjesec, godina; 
    gettime(sat, minut, sekund); 
    getdate(godina, mjesec, dan); 
    format(datum, sizeof datum, "~w~%02d %02d %02d", dan, mjesec, godina); 
    PlayerTextDrawSetString(playerid, TDEditor_PTD[playerid][0], datum); 
    format(vrijeme, sizeof vrijeme, "~w~%02d %02d %02d", sat, minut, sekund); 
    PlayerTextDrawSetString(playerid, TDEditor_PTD[playerid][1], vrijeme); 
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]); 
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]); 
    return 1; 
}
Shouldn't one of the textdraw array index be 1?


Re: Can someone help me?? - Micko123 - 23.07.2016

I changed that after seeing it. Still the same


Re: Can someone help me?? - Deadpoop - 23.07.2016

Stop using stocks for no reason!
you can just use like that:
PHP код:
test(playeridcolormsg[])
{
    
SendClientMessage(playeridcolormsg);
    return 
1;

And about the stock: https://sampforum.blast.hk/showthread.php?tid=570635


Re: Can someone help me?? - Micko123 - 23.07.2016

Quote:
Originally Posted by Deadpoop
Посмотреть сообщение
Stop using stocks for no reason!
you can just use like that:
PHP код:
test(playeridcolormsg[])
{
    
SendClientMessage(playeridcolormsg);
    return 
1;

And about the stock: https://sampforum.blast.hk/showthread.php?tid=570635
Dude i know that. I am just asking whatis wrong with this!!


Re: Can someone help me?? - SickAttack - 23.07.2016

Quote:
Originally Posted by Deadpoop
Посмотреть сообщение
Stop using stocks for no reason!
you can just use like that:
PHP код:
test(playeridcolormsg[])
{
    
SendClientMessage(playeridcolormsg);
    return 
1;

And about the stock: https://sampforum.blast.hk/showthread.php?tid=570635
Pure non-sense, there's no reason for him not to use stock.

And it's a function, not a damn stock! Stock is just a keyword.


Re: Can someone help me?? - Deadpoop - 23.07.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Pure non-sense, there's no reason for him not to use stock.

And it's a function, not a damn stock! Stock is just a keyword.
Stock is function that like doesnt exist unless tou use it why would he need it for fs or gm

If he create unclude then ok but if fs or gm its not needed!