21.03.2011, 23:06
Quote:
I suppose this function accepts a string, but you've declared it as in integer:
GetWeaponIDFromName(Weap) |
pawn Код:
CMD:giveallweapon(playerid,params[])
{
if(PInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
new Weap,WeapID[20], ammo, name[MAX_PLAYER_NAME], string[128];
if(sscanf(params,"si",Weap, ammo)) return SendClientMessage(playerid,RED,"Usage: /giveallweapon [weapon name] [ammo]");
if(!IsValidWeapon(Weap)) return SendClientMessage(playerid,RED,"ERROR: Invalid weapon ID");
ACMDM(playerid,"GIVEALLWEAPON");
GetWeaponIDFromName(Weap,WeapID,20); //3024
foreach(Player, i)
{
PlayerPlaySound(i,1057,0.0,0.0,0.0);
GivePlayerWeapon(i,WeapID,ammo); //3028
}
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Administrator %s has given all players weapon: %s with %d ammo",name,Weap,ammo);
SendClientMessageToAll(blue,string);
}
else return SendClientMessage(playerid,RED,"You are not a high enough level to use this command");
return 1;
}
pawn Код:
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(3024) : error 035: argument type mismatch (argument 1)
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(3028) : error 035: argument type mismatch (argument 2)