/giveweapon 0 ak47 500
new WeaponNames[46][] = {
{"Fist"},{"Brass Knuckles"}, //continue in the right order of the weaps here just like me
};
new aWeapons[] =
{
"Fist",
"Brass Knuckles",
"Golf Club",
"Nightstick",
"Knife",
"Baseball Bat",
"Shovel",
"Pool Cue",
"Katana",
"Chainsaw",
"Double-ended Dildo",
"Dildo",
"Vibrator",
"Silver Vibrator",
"Flowers",
"Cane",
"Grenade",
"Tear Gas",
"Molotov Cocktail",
"9mm",
"Silenced 9mm",
"Desert Eagle",
"Shotgun",
"Sawnoff Shotgun",
"Combat Shotgun",
"Micro SMG/Uzi",
"MP5",
"AK-47",
"M4",
"Tec-9",
"Country Rifle",
"Sniper Rifle",
"RPG",
"HS Rocket",
"Flamethrower",
"Minigun",
"Satchel Charge",
"Detonator",
"Spraycan",
"Fire Extinguisher",
"Camera",
"Night Vis Goggles",
"Thermal Goggles",
"Parachute"
};
YCMD:gweapon(playerid, params[], help)
{
if (help)
{
SendClientMessage(playerid, 0xFF0000AA, "Give a player a weapon.");
}
else
{
new str[128], p1, p2[32], p3;
if (isnull(params))
{
format(str, sizeof (str), "Usage: \"/%s [playerid] [weapon name] [ammo amount]\"", Command_GetDisplayNamed("gweapon", playerid));
SendClientMessage(playerid, 0xFF0000AA, str);
}
else
{
if(!sscanf(params, "us[32]i", p1,p2,p3))
{
//
for (new i = 0; i == sizeof(aWeapons); i++)
{
if(strcmp(p2, aWeapons[i], true) == 0)
{
if(p1 != INVALID_PLAYER_ID)
{
GivePlayerWeapon(p1, i, p3);
}
return 1;
}
}
}
}
}
return 1;
}
COMMAND:slap(playerid, params[])
{
SendAdminText(playerid, "/slap", params);
{
new ID;
if(APlayerData[playerid][PlayerLevel] < 1) return SendClientMessage(playerid, -1, "{ff0000}you are not admin");
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "{ff0000}Use: /slap [ID]");
new Float:Pos[3];
GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
}
return 1;
}
COMMAND:gweapon(playerid, params[])
{
new
str[128],p1,p2[32],p3;
if (isnull(params))
{
format(str, sizeof (str), "Usage: \"/%s [playerid] [weapon name] [ammo amount]\"", "gweapon");
SendClientMessage(playerid, 0xFF0000AA, str);
}
else
{
if(!sscanf(params, "us[32]i", p1,p2,p3))
{ //
for (new i = 0; i == sizeof(aWeapons); i++)
{
if(strcmp(p2, aWeapons[i], true) == 0)
{
if(p1 != INVALID_PLAYER_ID)
{
GivePlayerWeapon(p1, i, p3);
}
return 1;
}
}
{
}
return 1;
}
YCMD:gweapon(playerid, params[], help)
COMMAND:gweapon(playerid, params[])
COMMAND:gweapon(playerid, params[])
{
new str[128], p1, p2[32], p3;
if (isnull(params))
{
format(str, sizeof (str), "Usage: \"/%s [playerid] [weapon name] [ammo amount]\"", Command_GetDisplayNamed("gweapon", playerid));
SendClientMessage(playerid, 0xFF0000AA, str);
}
else
{
if(!sscanf(params, "us[32]i", p1,p2,p3))
{
//
for (new i = 0; i == sizeof(aWeapons); i++)
{
if(strcmp(p2, aWeapons[i], true) == 0)
{
if(p1 != INVALID_PLAYER_ID)
{
GivePlayerWeapon(p1, i, p3);
}
return 1;
}
}
}
}
return 1;
}
try this not sure if it will work...
pawn Код:
|