24.04.2012, 23:08
command /giveallweapon from LuxAdmin doesnt work.. how to fix?
it gives correctly the weapon but with 0 ammo's, even if you specify 999 ammo's.
whats the problem?
Код:
dcmd_giveallweapon(playerid,params[]) { if(AccInfo[playerid][Level] >= 3) { new tmp[256], tmp2[256], Index; new ammo, weap, WeapName[32]; new string[128]; tmp = strtok(params,Index); tmp2 = strtok(params,Index); if(!strlen(tmp)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /giveallweapon [WeaponID or WeaponName] [Ammo]") && SendClientMessage(playerid, orange, "Function: Will give a specified weapon and ammo for all players"); if(!strlen(tmp2) || !IsNumeric(tmp2) || strval(tmp2) <= 0 || strval(tmp2) > 99999) ammo = 500; if(!IsNumeric(tmp)) weap = GetWeaponIDFromName(tmp); else weap = strval(tmp); if(!IsValidWeapon(weap)) return SendClientMessage(playerid,red,"ERROR: Invalid Weapon ID"); SendCommandToAdmins(playerid,"GiveAllWeapon"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { PlayerPlaySound(i,1057,0.0,0.0,0.0); GivePlayerWeapon(i,weap,ammo); } } GetWeaponName(weap, WeapName, sizeof(WeapName)); format(string,sizeof(string),"All Players received a %s (%d) with %d rounds of Ammo", WeapName, weap, ammo); return SendClientMessageToAll(pmsg, string); } else return ErrorMessages(playerid, 1);
whats the problem?