Here's a script I made (Took me awhile since there were ALOT of bugs but they are all or mostly fixed.)
One important thing, Yes it does actually save the weapons on relog.
if(strcmp(cmd, "/giveweapon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "CMD: /giveweapon [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new gunid = GetPlayerWeapon(playerid);
new WeaponName[65];
if(gunid == 1) { WeaponName = "Brass Knuckles"; }
if(gunid == 2) { WeaponName = "Golf Club"; }
if(gunid == 3) { WeaponName = "Nightstick"; }
if(gunid == 4) { WeaponName = "Knife"; }
if(gunid == 5) { WeaponName = "Baseball Bat"; }
if(gunid == 6) { WeaponName = "Shovel"; }
if(gunid == 7) { WeaponName = "Pool Cue"; }
if(gunid ==
{ WeaponName = "Katana"; }
if(gunid == 9) { WeaponName = "Chainsaw"; }
if(gunid == 10) { WeaponName = "Dildo"; }
if(gunid == 11) { WeaponName = "Dildo"; }
if(gunid == 12) { WeaponName = "Vibrator"; }
if(gunid == 13) { WeaponName = "Sliver Vibrator"; }
if(gunid == 14) { WeaponName = "Flowers"; }
if(gunid == 15) { WeaponName = "Cane"; }
if(gunid == 16) { WeaponName = "Grenade"; }
if(gunid == 17) { WeaponName = "Tear Gas"; }
if(gunid == 18) { WeaponName = "Molotov Cocktail"; }
if(gunid == 22) { WeaponName = "Colt 45"; }
if(gunid == 23) { WeaponName = "Silenced 9mm"; }
if(gunid == 24) { WeaponName = "Desert Eagle"; }
if(gunid == 25) { WeaponName = "Shotgun"; }
if(gunid == 26) { WeaponName = "Sawnoff Shotgun"; }
if(gunid == 27) { WeaponName = "Combat Shotgun"; }
if(gunid == 28) { WeaponName = "Uzi"; }
if(gunid == 29) { WeaponName = "MP5"; }
if(gunid == 30) { WeaponName = "AK-47"; }
if(gunid == 31) { WeaponName = "M4"; }
if(gunid == 32) { WeaponName = "Tec-9"; }
if(gunid == 33) { WeaponName = "Rifle"; }
if(gunid == 34) { WeaponName = "Sniper Rifle"; }
if(gunid == 35) { WeaponName = "RPG"; }
if(gunid == 36) { WeaponName = "Heat Seaker"; }
if(gunid == 37) { WeaponName = "Flamethrower"; }
if(gunid == 38) { WeaponName = "Minigun"; }
if(gunid == 39) { WeaponName = "Satchel Charge"; }
if(gunid == 40) { WeaponName = "Detonator"; }
if(gunid == 41) { WeaponName = "Spraycan"; }
if(gunid == 42) { WeaponName = "Fire Extinguisher"; }
if(gunid == 43) { WeaponName = "Camera"; }
if(gunid == 44) { WeaponName = "Night Vision Goggles"; }
if(gunid == 45) { WeaponName = "Thermal Goggles"; }
if(gunid == 46) { WeaponName = "Parachute"; }
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetWeaponName(gunid, WeaponName, 64);
if(IsPlayerConnected(giveplayerid))
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(playerid == giveplayerid)
{
SendClientMessage(playerid, COLOR_GREY, " You can't give to yourself !");
return 1;
}
if(gunid == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You aren't holding a weapon!");
return 1;
}
if(giveplayerid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, " That player is offline.");
}
else
{
TakeWeapon(playerid,gunid);
GivePlayerGun(giveplayerid,gunid);
format(string, sizeof(string), " You have given %s a %s.", giveplayer, WeaponName);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved a %s from %s.", WeaponName, sendername);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "* %s has given %s a %s.", sendername, giveplayer, WeaponName);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PayLog(string);
return 1;
}
}
}
}
}
pastebin(DOT)com/aj3P0fMP
replace the (DOT) with a .