Setting value - 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: Setting value (
/showthread.php?tid=627085)
Setting value -
Loinal - 23.01.2017
PHP код:
CMD:setvalue(playerid,params[])
{
new value, weaponid,string[200];
if(sscanf(params, "dk<weapon>", value, weaponid)) return SendClientMessage(playerid,0xFF0000F,"USAGE: /setvalue [Value] [WeaponName]"); // You need to put integer at first, and you can use sscanf kustom specifier to get weaponid by name
if(weaponid == 24)
{
Deagle = value;
format(string,sizeof(string),"Succeffly setted Deagle value to %d",value);
SendClientMessage(playerid,0xFF0000F,string);
}
return 1;
}
That is not working why?
Re: Setting value -
haikalbintang - 31.01.2017
Your CMDS doesn't contain GivePlayerWeapon, fix it like this :
PHP код:
CMD:setvalue(playerid,params[])
{
new value, weaponid,string[200];
if(sscanf(params, "dk<weapon>", value, weaponid)) return SendClientMessage(playerid,0xFF0000F,"USAGE: /setvalue [Value] [WeaponName]"); // You need to put integer at first, and you can use sscanf kustom specifier to get weaponid by name
if(weaponid == 24)
{
Deagle = value;
GivePlayerWeapon(playerid, 24, value);
format(string,sizeof(string),"Succeffly setted Deagle value to %d",value);
SendClientMessage(playerid,0xFF0000F,string);
}
return 1;
}