Stock ConvertWeaponID(ID)
{
If(ID == 24)
{
new Str[10] = "Deagle";
return Str;
}
}
new WeaponNameStr[10] = ConvertWeaponID(30);
stock GetWeaponByID(weapon)
{
new string[30];
GetWeaponName(weapon, string, sizeof(string));
return string;
}
printf("%s", GetWeaponByID(24));
Weapon_ReturnType(iFac, playerid) { new szName[32] = "Undefined Weapon", iFac = arrFaction[playerid][g_iFactionID]; switch(arrFaction[iFac][g_iLockerGuns]) { case 1: szName = "Brass Knuckles"; case 2: szName = "Golf Club"; case 3: szName = "Nightstick"; case 4: szName = "Knife"; case 5: szName = "Baseball Bat"; case 6: szName = "Shovel"; case 7: szName = "Pool Cue"; case 8: szName = "Katana"; case 9: szName = "Chainsaw"; case 10: szName = "Double-ended Dildo"; } return szName; } |
format(string, sizeof(string), "%s - Get weapon", Weapon_ReturnType(iFac)); ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel"); |
new WeaponNames[47][] =
{
"Unarmed","BrassKnuckles","Golfclub","Nitestick","Knife","Baseball Bat","Shovel","Poolcue","Katana","Chainsaw","Purple Dildo","Small White Vibrator","Large White Vibrator","Silver Vibrator",
"Flowers","Cane","Grenade","Tear Gas Grenade","Molotov Cocktail","Jetpack"," "," ","9mm","Silenced 9mm","Deagle","Shotgun","Sawn-Off Shotgun","SPAS-12",
"MicroUzi","MP5","AK-47","M4","Tec-9","Rifle","Sniper Rifle","RPG","Heatseeker","Flamethrower","Minigun","SatchelCharge","Detonator","SprayCan","Fire Extinguisher",
"Camera","Nightvision Goggles", "Thermal Goggles","Parachute"
};
WeaponNames[*INSERTGENERICID*]
pawn Код:
pawn Код:
|
format(string, sizeof(string), "%s - Get weapon", WeaponNames[4]); ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel"); |
new str[5];GetWeaponName(inputtext, str, sizeof(str));
format(string, sizeof(string), "%s - Get weapon", str);
ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel");
'error 017: undefined symbol "inputtext"' |
CMDetfactionweapons(playerid, params[]) { new iFac = arrFaction[playerid][g_iFactionID], weapons; if(arrFaction[playerid][p_iMember] == 12 || arrFaction[playerid][p_iMember] == 11) { if(sscanf(params, "d", weapons)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setfactionweapons [weaponid]"); arrFaction[iFac][g_iLockerGuns] = weapons; CreateDynamicFaction(weapons); SendClientMessage(playerid, COLOR_WHITE, "You have changed the weapon ID's for your faction."); } else SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use that command!"); return 1; } |
CMD:testlocker(playerid, params[]) { new string[256], iFac = arrFaction[playerid][g_iFactionID]; if(arrFaction[playerid][p_iMember] > 0) { if(arrFaction[iFac][g_iLockerGuns] == 0) { SendClientMessage(playerid, COLOR_WHITE, "Your faction lockers have no weapons in them!"); } if(arrFaction[iFac][g_iLockerGuns] > 0) { /*format(string, sizeof(string), "%s - $320", WeaponNames[4]); ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel");*/ new str[5];GetWeaponName(inputtext, str, sizeof(str)); format(string, sizeof(string), "%s - Get weapon", str); ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel"); } } else SendClientMessage(playerid, COLOR_WHITE, "You are not in a faction!"); return 1; } |
CMD:testlocker(playerid, params[])
{
new string[256], iFac = arrFaction[playerid][g_iFactionID];
if(arrFaction[playerid][p_iMember] > 0)
{
if(arrFaction[iFac][g_iLockerGuns] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Your faction lockers have no weapons in them!");
}
if(arrFaction[iFac][g_iLockerGuns] > 0)
{
new str[5];GetWeaponName(arrFaction[iFac][g_iLockerGuns], str, sizeof(str));
format(string, sizeof(string), "%s - Get weapon", str);
ShowPlayerDialog(playerid, DIALOG_FACWEPS, DIALOG_STYLE_LIST, "Faction Locker", string, "Select", "Cancel");
}
}
else SendClientMessage(playerid, COLOR_WHITE, "You are not in a faction!");
return 1;
}