CMD:giveweaponall(playerid, params[])
{
if(pInfo[playerid][Admin] < 4) return NotAdminMSG(playerid);
new string[128], weapid, ammo;
if(sscanf(params, "ii", weapid, ammo)) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"/giveweaponall [WEAPON_ID] [AMMO]");
if(ammo <= 0) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"Minimum ammo is 1.");
if(weapid <= 0 || weapid == 19 || weapid == 20 || weapid == 21 || weapid > 46) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"Invalid weapon ID.");
if(weapid == 35 || weapid == 36 || weapid == 37 || weapid == 38 || weapid == 39 || weapid == 40) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"You are not allowed to give this weapons.");
/*line 127*/ format(string, sizeof(string), ""WORD_ADMIN"Everyone has been given a %s by %s(%d).", WeapName(weapid), PlayerName(playerid), playerid); //line 127
SCMToAll(COLOR_WHITE, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerWeapon(playerid, weapid, ammo);
}
return 1;
}
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(127) : error 012: invalid function call, not a valid address C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(127) : warning 215: expression has no effect C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(127) : error 001: expected token: ";", but found ")" C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(127) : error 029: invalid expression, assumed zero C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(127) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
playerid
i
GivePlayerWeapon(i, weapid, ammo);
if(ammo <= 0) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"Minimum ammo is 1.");
if(ammo <= 0 || ammo > your_value) return SCM(playerid, COLOR_WHITE, ""WORD_ERROR"Minimum ammo is 1.");
new WeapName[47][20] = { "Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Basebal Bat","Shovel","Pool Cue","Katana","Chainsaw","Double-ended Dildo","Dildo","Vibrator", "Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotv Cocktail","?","?","?","9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff-Shotgun", "Combat Shotgun","Micro-SMG","MP5","Ak-47","M4","Tec9","Country Rifle","Sniper Rifle","RPG","HS-RPG","Flame-Thrower","Minigun","Satchel Charge","Detonator", "Spray Can","Fire Extinguisher","Camera","Night Goggles","Thermal Goggles","Parachute" };
new WeapName[] =
{
"Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Basebal Bat","Shovel","Pool Cue","Katana","Chainsaw","Double-ended Dildo","Dildo","Vibrator",
"Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotv Cocktail","?","?","?","9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff-Shotgun",
"Combat Shotgun","Micro-SMG","MP5","Ak-47","M4","Tec9","Country Rifle","Sniper Rifle","RPG","HS-RPG","Flame-Thrower","Minigun","Satchel Charge","Detonator",
"Spray Can","Fire Extinguisher","Camera","Night Goggles","Thermal Goggles","Parachute"
};
try this:
pawn Код:
|
WeapName[][]
printf("%s", WeapName[2]);