03.02.2013, 23:34
(
Последний раз редактировалось Strier; 04.02.2013 в 00:50.
)
pawn Код:
CMD:giveallweapon(playerid,params[])
{
if(PlayerInfo[playerid][Level] >= 4)
{
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /giveweapon [playerid] [weapon id/weapon name] [ammo]");
new Weap, ammo, WeapName1[32], string[128];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
if(Weap == 38 || Weap == 36) return SP red, "You cannot give those weapons!");
if(!IsNumeric(tmp2)) Weap = GetWeaponIDFromName(tmp2); else Weap = strval(tmp2);
if(!IsValidWeapon(Weap)) return SendClientMessage(playerid,red,"ERROR: Invalid weapon ID");
CMDMessageToAdmins(playerid,"GIVEALLWEAPON");
GetWeaponName(Weap,WeapName1,32);
format(string,sizeof(string),"Administrator %s has given all players weapon: %s (%d) with %d ammo",WeapName1,Weap,ammo);
SendClientMessage(playerid, blue, string);
}return GivePlayerWeapon(playerid, WeapName1, Weap, ammo);
}else return SP, red, "You need to be level 4+ to use this command");
}
Errors:
pawn Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\TD.pwn(13673) : error 035: argument type mismatch (argument 2)
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\TD.pwn(13674) : error 010: invalid function or declaration
pawn Код:
if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /giveweapon [playerid] [weapon id/weapon name] [ammo]");
new Weap, ammo, WeapName1[32], string[128];
pawn Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\TD.pwn(13670) : error 048: array dimensions do not match
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\TD.pwn(13673) : error 035: argument type mismatch (argument 2)
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\TD.pwn(13674) : error 010: invalid function or declaration