Command Help! - 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: Command Help! (
/showthread.php?tid=410496)
Command Help! -
nor15 - 25.01.2013
i use stevo's gamemode and i added a command but when i try it it say unknown command
Код:
dcmd_gunpack(playerid,params[])
{
#pragma unused params
if(IsRegularPlayer[playerid] != 1337)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be a regular player to use GunPack.");
return 1;
}
if(IsRegularPlayer[playerid] == 1337)
{
GivePlayerWeapon(playerid, 26, 1000);
return 1;
}
return 1;
}
Re: Command Help! -
ViniBorn - 25.01.2013
Try
pawn Код:
dcmd_gunpack(playerid,params[])
{
#pragma unused params
if(IsRegularPlayer[playerid] != 1337) return SendClientMessage(playerid,COLOR_ERROR,"You must be a regular player to use GunPack.");
GivePlayerWeapon(playerid, 26, 1000);
return true;
}
Re: Command Help! -
IPrototypeI - 25.01.2013
Quote:
Originally Posted by Viniborn
Try
pawn Код:
dcmd_gunpack(playerid,params[]) { #pragma unused params if(IsRegularPlayer[playerid] != 1337) return SendClientMessage(playerid,COLOR_ERROR,"You must be a regular player to use GunPack.");
GivePlayerWeapon(playerid, 26, 1000); return true; }
|
you can even return GivePlayerWeapon or an other number than zero
PHP код:
dcmd_gunpack(playerid,params[])
{
#pragma unused params
if(IsRegularPlayer[playerid] != 1337) return SendClientMessage(playerid,COLOR_ERROR,"You must be a regular player to use GunPack.");
return GivePlayerWeapon(playerid, 26, 1000);
}
because OnPlayerCommandText are not interesting of returning other numbers than zero
but you can't return floats or strings
Re: Command Help! -
nor15 - 25.01.2013
when i compile it , it got no problem but when i enter the server it got the same , so i looked under onplayercommandtext i found commands and i edited one of them to
but it still not working