30.05.2012, 19:49
Hello,
I have changed my Agiveweapon command so i can decide how much ammo i want.
but when i do it in game you see very fast the weapon icon in the right top, but then it dissapears.
Maybe someone can look at it
I have changed my Agiveweapon command so i can decide how much ammo i want.
but when i do it in game you see very fast the weapon icon in the right top, but then it dissapears.
Maybe someone can look at it
pawn Код:
command(agiveweapon, playerid, params[])
{
new WeaponN[60], Names[2][MAX_PLAYER_NAME], string[128], id, weaponid, ammo;
if(sscanf(params, "ud", id, weaponid, ammo))
{
if(Player[playerid][AdminLevel] >= 3)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /agiveweapon [playerid] [weaponid] [ammo]");
}
}
else
{
if(Player[playerid][AdminLevel] >= 3)
{
if(IsPlayerConnectedEx(id))
{
if(weaponid >= 1 && weaponid < 47)
{
GetPlayerName(id, Names[0], MAX_PLAYER_NAME);
GetPlayerName(playerid, Names[1], MAX_PLAYER_NAME);
if(weaponid == 19)
{
SetPlayerSpecialAction(id, SPECIAL_ACTION_USEJETPACK);
format(string, sizeof(string), "You have given %s a Jetpack (Weapon ID: 19).", GetName(id), weaponid);
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "You have been given a Jetpack, from %s.", GetName(playerid));
SendClientMessage(id, WHITE, string);
Player[id][HasJetpack] = 1;
format(string, sizeof(string), "%s has been given weapon %d by %s.", Names[0], weaponid, Names[1]);
AdminActionsLog(string);
}
else
{
GetWeaponName(weaponid, WeaponN, sizeof(WeaponN));
GivePlayerWeapon(id, weaponid, ammo);
format(string, sizeof(string), "You have given %s a %s (Weapon ID: %d).", GetName(id), WeaponN, weaponid);
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "You have been given a %s, from %s.", WeaponN, GetName(playerid));
SendClientMessage(id, WHITE, string);
format(string, sizeof(string), "%s has been given weapon %d by %s.", Names[0], weaponid, Names[1]);
AdminActionsLog(string);
}
}
else
{
SendClientMessage(playerid, WHITE, "Invalid weapon ID.");
}
}
else
{
SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
}
}
}
return 1;
}