public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gooz", cmdtext, true) == 0)
{
GivePlayerMoney(playerid,2500);
}
return 0;
}
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(playerid, cmdtext[])
{
if (strcmp("/adaarma", cmdtext, true) == 0)
{
GivePlayerMoney(playerid,2500);
}
if (strcmp("/ada", cmdtext, true) == 0)
{
GivePlayerWeapon(playerid,WEAPON_SILENCED,1483);
}
return 0;
}
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; } |
forward message();
public OnGameModeInit()
{
print("Starting timer...");
SetTimer("message", 1000, false); // Set a timer of 1000 miliseconds (1 second)
}
public message()
{
print("1 second has passed.");
}
//Got from samp wiki