AlexCelTare Posted December 16, 2021 Report Share Posted December 16, 2021 Stie cineva sa faca o comanda de tip /givegun playerid gunid ammo? Exista vreun sample? Quote Link to comment Share on other sites More sharing options...
Hackeru Suprem Posted November 1, 2023 Report Share Posted November 1, 2023 CMD:givegun(playerid, params[]) { new adminLevel = GetPlayerAdminLevel(playerid); if (adminLevel < 1) { SendClientMessage(playerid, COLOR_RED, "You need to be an admin (level 1 or higher) to use this command."); // poti modifica din admin 1 in ce admin vrei tu return 1; } if (params[0] < 0 || params[0] >= MAX_PLAYERS || !IsPlayerConnected(params[0])) { SendClientMessage(playerid, COLOR_RED, "Invalid player ID. Please specify a valid online player."); return 1; } new gunid, ammo; if (sscanf(params, "ui", gunid, ammo)) { if (gunid < 0 || gunid >= MAX_WEAPONS) { SendClientMessage(playerid, COLOR_RED, "Invalid weapon ID. Please specify a valid weapon ID."); return 1; } if (ammo < 0) { SendClientMessage(playerid, COLOR_RED, "Invalid ammo amount. Please specify a non-negative value."); return 1; } GivePlayerWeapon(params[0], gunid, ammo); SendClientMessage(playerid, COLOR_GREEN, "You've given weapon ID: " + gunid + " with " + ammo + " ammo to player ID: " + params[0]); } else { SendClientMessage(playerid, COLOR_RED, "Usage: /givegun [playerid] [gunid] [ammo]"); } return 1; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.