United Kingdom Roleplay

Welcome to the United Kingdom Roleplay Forum
 
HomeGalleryFAQSearchMemberlistUsergroupsRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Keywords
Latest topics
December 2017
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031
CalendarCalendar
Affiliates
free forum


Share | 
 

 /giveweapon

View previous topic View next topic Go down 
AuthorMessage
Kalvin
Newbie
Newbie


Posts : 5
Join date : 2012-06-16

PostSubject: /giveweapon   Thu Jun 21, 2012 8:45 pm

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 == Cool { 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 .


Last edited by Kalvin on Thu Jun 21, 2012 8:46 pm; edited 1 time in total (Reason for editing : Smiling face in (gunid == 8))
Back to top Go down
View user profile
Sean
Admin
Admin


Posts : 48
Join date : 2012-05-29

PostSubject: Very good :)   Fri Jun 22, 2012 12:31 pm

This is excellent Smile
Back to top Go down
View user profile http://ukrp.englishboard.net
Kalvin
Newbie
Newbie


Posts : 5
Join date : 2012-06-16

PostSubject: Re: /giveweapon   Fri Jun 22, 2012 4:45 pm

For some reason there is no spaces to make the command look nice, but i guess Lewis can do that...
Back to top Go down
View user profile
Andrew Austen
Newbie
Newbie
avatar

Posts : 10
Join date : 2012-06-21
Location : Uzbekistan.

PostSubject: Re: /giveweapon   Sat Jun 23, 2012 12:20 am

Sounds like a great idea! should definitely be added Smile
Back to top Go down
View user profile
Ethan_Marcus
Newbie
Newbie


Posts : 14
Join date : 2012-06-15

Character
RP:
5/5  (5/5)

PostSubject: Re: /giveweapon   Sat Jun 30, 2012 5:45 am

DONE

ps : thanks for your help see you ig
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: /giveweapon   

Back to top Go down
 
/giveweapon
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
United Kingdom Roleplay :: Server :: Suggestions :: Weapons & Drugs suggestions-
Jump to: