07.05.2013, 01:25
Lol, that GetGunName is so unoptimized. You do 40+ conditions to get only one weapon name :/
I wrote this for u
And you don't need to format a string, if you will not use placeholders.
You cant just do:
I wrote this for u
pawn Code:
new GunName[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"
};
// Example of use:
CMD:mygun(playerid)
{
new text[48];
format(text,sizeof text,"You've got a nice: {FFFFFF}%s",GunName[GetPlayerWeapon(playerid)]);
SendClientMessage(playerid,0xFFDD22FF,text);
return 1;
}
You cant just do:
pawn Code:
new var[30] = "Var Test";
// or
new var[35];
switch(playerid)
{
case 0: var = "First Player!";
case 1: var = "Second Player!";
default: var = "You're not first neither second :/";
}