Quote:
Originally Posted by BenzoAMG
Yes, the second poster has either scripted the code mindlessly without testing it first, or copied it from other script, which shows a lack of effort and a prospering laze in my opinion.
pawn Код:
CMD:givegun(playerid, params[]) { new targetid, weaponid; if(sscanf(params, "ui", targetid, weaponid)) return SendClientMessage(playerid, -1, "Usage: /givegun [name/id] [gun]"); if(weaponid < 0 || (weaponid > 18 && weaponid < 22) || weaponid > 46) return SendClientMessage(playerid, -1, "Invalid weapon ID."); //I was going to create a function like IsValidWeapon, but I think it may cause more confusion for new scripters. if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "User is not connected!"); GivePlayerWeapon(targetid, weaponid, 200); //You can change the ammo from 200 to whatever you wish. if(targetid == playerid) return SendClientMessage(playerid, 0xFFFF00FF, "You have given yourself a weapon."); SendClientMessage(playerid, 0xFFFF00FF, "You have given a weapon to another player."); //Putting a player name/id here is optional. SendClientMessage(targetid, 0xFFFF00FF, "You have been given a weapon by another player."); //Putting a player name/id here is optional. return 1; }
|
Thank you so much, this worked, I appreciate it. +rep