SA-MP Forums Archive
problems with this cmds - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problems with this cmds (/showthread.php?tid=200393)



problems with this cmds - Face9000 - 18.12.2010

Hi all,i maked this cmds:

Код:
IRCCMD:blowcar(botid, channel[], user[], params[])
{
    if(IRC_IsOp(botid,channel,user))
	{
	new ID;
	if(sscanf(params,"dz",ID)) return IRC_GroupSay(gGroupID, channel,"USAGE: !blowcar [playerID]");
	if(!IsPlayerConnected(ID))return IRC_GroupSay(gGroupID, channel,"ERROR: Invalid ID.");
	if(!IsPlayerInAnyVehicle(ID)) return IRC_GroupSay(gGroupID, channel,"ERROR: The selected ID is currently on foot.");
	SetVehicleHealth((GetPlayerVehicleID(ID)),-99999);
	}	else IRC_GroupSay(gGroupID, channel,"Error: You must be operator to use this command.");
	return 1;
}
This:

Код:
IRCCMD:givegun(botid, channel[], user[], params[])
{
     	if(IRC_IsOp(botid,channel,user))
    	{
    	new ID = strval(params),tString[128], PlayerName[24];
    	GetPlayerName(ID,PlayerName,sizeof(PlayerName));
        new weapon;
        new WeaponName[64];
        new ammo;
        if(sscanf(params,"dd",ID,weapon)) return IRC_GroupSay(gGroupID, channel,"USAGE:!givegun [playerID] [weaponID]");
        if(!IsPlayerConnected(ID)) return IRC_GroupSay(gGroupID, channel,"ERROR: Invalid ID.");
        if(weapon > 46 || weapon < 0) return IRC_GroupSay(gGroupID, channel,"ERROR: Invalid Weapon ID.");
        ammo = 2500;
        GivePlayerWeapon(ID,weapon,ammo);
        GetWeaponName(weapon, WeaponName, 64);
        format(tString,sizeof(tString),"5 *** %s (ID:%d) has been given a %s with %d bullets.",PlayerName,ID,WeaponName,ammo);
        IRC_GroupSay(gGroupID, channel,tString);
	}	else IRC_GroupSay(gGroupID, channel,"Error: You must be operator to use this command.");
	return 1;
}
This:

Код:
IRCCMD:getip(botid, channel[], user[], params[])
{
  	if(IRC_IsOp(botid,channel,user))
	{
	new ID = strval(params), PlayerName[24];
	new tString[128];
	new IP[64];
    GetPlayerName(ID,PlayerName,sizeof(PlayerName));
	if(sscanf(params,"d",ID)) return IRC_GroupSay(gGroupID, channel,"USAGE: !getip [playerID]");
	if(!IsPlayerConnected(ID))return IRC_GroupSay(gGroupID, channel,"ERROR: Invalid ID.");
	GetPlayerIp(ID, IP, 256);
	format(tString,256,"5*** [Admin] %s (ID:%d) IP Address:1 %s.",PlayerName,ID,IP);
    IRC_GroupSay(gGroupID, channel,tString);
	}	else IRC_GroupSay(gGroupID, channel,"Error: You must be operator to use this command.");
	return 1;
}
If i do like !blowcar playerid,he return me the default message: USAGE: !blowcar [playerID]

Same with others commands?What i done wrong?


Re: problems with this cmds - Face9000 - 19.12.2010

BUMP.