SA-MP Forums Archive
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: Help me. (/showthread.php?tid=657444)



Help me. - Wreeper - 07.08.2018

C:\Users\Wreeper\Desktop\sal\gamemodes\localhost.p wn(290) : error 010: invalid function or declaration
C:\Users\Wreeper\Desktop\sal\gamemodes\localhost.p wn(293) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


}
if (strcmp("/adabani", cmdtext, true) == 0){
SetTimer("adabani", 10, 0);
}
return 1;
}
if (strcmp("/adaarma", cmdtext, true) == 0){
SetTimer("arma", 10, 0);
}
return 1;
}


Re: Help me. - taktaz - 07.08.2018

If you want to add commands , you should place their script under OnPlayerCommandText ...
NOTE: OnPlayerCommandText is in your script you should just search it.
For example:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/gooz"cmdtexttrue) == 0)
    {
        
GivePlayerMoney(playerid,2500);
    }
    return 
0;

if it helped please do rep


Re: Help me. - Wreeper - 07.08.2018

Quote:
Originally Posted by taktaz
Посмотреть сообщение
If you want to add commands , you should place their script under OnPlayerCommandText ...
NOTE: OnPlayerCommandText is in your script you should just search it.
For example:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/gooz"cmdtexttrue) == 0)
    {
        
GivePlayerMoney(playerid,2500);
    }
    return 
0;

if it helped please do rep
Yes, it's working one command only, but i will try with the other too. If it works too, i will give you rep. Thx anyway.


Re: Help me. - RODELA - 07.08.2018

I think you got your answer but still use this.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/adaarma"cmdtexttrue) == 0)
    {
        
GivePlayerMoney(playerid,2500);
    }
    if (
strcmp("/ada"cmdtexttrue) == 0)
    {
        
GivePlayerWeapon(playerid,WEAPON_SILENCED,1483);
    }
    return 
0;

I don't need +rep


Re: Help me. - taktaz - 09.08.2018

Quote:
Originally Posted by Wreeper
Посмотреть сообщение
C:\Users\Wreeper\Desktop\sal\gamemodes\localhost.p wn(290) : error 010: invalid function or declaration
C:\Users\Wreeper\Desktop\sal\gamemodes\localhost.p wn(293) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


}
if (strcmp("/adabani", cmdtext, true) == 0){
SetTimer("adabani", 10, 0);
}
return 1;
}
if (strcmp("/adaarma", cmdtext, true) == 0){
SetTimer("arma", 10, 0);
}
return 1;
}
You dont need to use timers , if you want you should use the correct parameters , here is an example:
PHP код:
forward message();
 
public 
OnGameModeInit()
{
    print(
"Starting timer...");
    
SetTimer("message"1000false); // Set a timer of 1000 miliseconds (1 second)
}
 
public 
message()
{
    print(
"1 second has passed.");
}
//Got from samp wiki