SA-MP Forums Archive
[HELP] How I can do this? +REP - 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: [HELP] How I can do this? +REP (/showthread.php?tid=523977)



[HELP] How I can do this? +REP - Shura - 04.07.2014

Hello, my question is, as I do a command to fill the stock of objects?

How I can do this?

Hello, my question is, as I do a command to fill the stock of objects?

CAUTION: Use
Код:
Update3DTextLabelText
Here I show that by a timmer that is filled every 30 minutes, I want to make a command that the stock is full and also the label information is updated


Код:
new CantidadM = 282000;
Код:
new Text3D:minero;
Код:
minero = Create3DTextLabel("282.000 materiales disponibles para juntar minas", -1,2435.5171,-972.6533,79.3923, 20.0, 0 , 4);
Код:
forward CantidadMinas();
public CantidadMinas()
{
new string[256];
CantidadM --;
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
Update3DTextLabelText(minero, 0xFFFFFFFF, string);
return 1;
}
Код:
forward CamionM();
public CamionM()
{
new string[256];
CantidadM = 282000;
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
Update3DTextLabelText(minero, 0xFFFFFFFF, string);
return 1;
}
// Onplayerupdate
Код:
SetTimer("CamionM",1800000,1);
I Use ZCMD , please help.


Re: [HELP] How I can do this? +REP - DarkZeroX - 04.07.2014

"SetTimer("CamionM",1800000,1);" goto public OnGameModInit


Respuesta: Re: [HELP] How I can do this? +REP - Shura - 04.07.2014

Quote:
Originally Posted by DarkZeroX
Посмотреть сообщение
"SetTimer("CamionM",1800000,1);" goto public OnGameModInit
__________________________________________________ __________________________________

Thanks, but as you could make a command to fill the stock? Can you help me?


Re: [HELP] How I can do this? +REP - DarkZeroX - 04.07.2014

PHP код:
#define MAX_CANTIDAD 282000

new CantidadM MAX_CANTIDAD;
new 
Text3D:minero;


public 
OnGameModInit()
{
    
minero Create3DTextLabel("282.000 materiales disponibles para juntar minas", -1,2435.5171,-972.6533,79.392320.04);
    
SetTimer("CamionM",1800000,1);
    return 
1;
}

forward CamionM();
public 
CamionM()
{
    new 
string[256];

    
CantidadM MAX_CANTIDAD;

    
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
    
Update3DTextLabelText(minero0xFFFFFFFFstring);
    return 
1;
}

forward CantidadMinas();
public 
CantidadMinas()
{
    new 
string[256];
    
CantidadM --;

    
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
    
Update3DTextLabelText(minero0xFFFFFFFFstring);
    return 
1;
}

CMD:Cantidad(playeridparams[])
{
     
CantidadMinas();
     return 
1;




Respuesta: [HELP] How I can do this? +REP - Shura - 04.07.2014

Thanks, but instead of climbing the value decreases, (In Update3DTextLabelText) to do?


Whenever I use CMD: amount, what it does is subtract 1 on 1


Re: [HELP] How I can do this? +REP - DarkZeroX - 04.07.2014

PHP код:
forward CantidadMinas();
public 
CantidadMinas()
{
    new 
string[256];
    
CantidadM++;

    
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
    
Update3DTextLabelText(minero0xFFFFFFFFstring);
    return 
1;




Respuesta: [HELP] How I can do this? +REP - Shura - 04.07.2014

This is a work in my gamemode, whenever you pick the item stock is subtracted, understand? Therefore I can not use the + + in CantidadM++ (Forward CantidadMinas)


Re: [HELP] How I can do this? +REP - DarkZeroX - 04.07.2014

hmm, ++ = +1 | -- = -1 or -=number

PHP код:
forward CantidadMinas();
public 
CantidadMinas()
{
    new 
string[256];
    if(
CantidadM MAX_CANTIDAD) return 1;
    
CantidadM++;
    
format(string,sizeof(string),"%d materiales disponibles para juntar minas",CantidadM);
    
Update3DTextLabelText(minero0xFFFFFFFFstring);
    return 
1;



Sorry bad English :/


Respuesta: [HELP] How I can do this? +REP - Shura - 04.07.2014

If you use any stock that does not subtract the time to go look for when people realizen his work, I understand?


Re: [HELP] How I can do this? +REP - DarkZeroX - 04.07.2014

I'm sorry I'm french I do not understand :/