10.05.2010, 23:59
i put in a /dropgun command but how do i put in a /pickup command becuse i need to be able to pick up the gun form the ground and when i put /dropgun it disapears i want it to be on the ground so i can see it
heres my code
if (strcmp("/dropgun", cmdtext, true, 10) == 0)
{
if(GetPlayerWeapon(playerid) == 0) return SendClientMessage(playerid,0xFF0000FF,"You haven't gun in Your hand.");
new name[MAX_PLAYER_NAME],msg[128],Float,Float:y,Float:z;
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
GetPlayerPos(playerid,x,y,z);
new WhatGun = GetPlayerWeapon(playerid);
new HowMuch = GetPlayerAmmo(playerid);
GivePlayerWeapon(playerid,WhatGun,-HowMuch);
format(msg,128,"%s has dropped his/her weapon on the floor.",name);
for(new i=0;i<MAX_PLAYERS;i++){
if(IsPlayerConnected(playerid)){
if(IsPlayerInRangeOfPoint(i,15,x,y,z)){
SendClientMessage(i,0xC2A2DAAA,msg);
}
}
}
return 1;
}
heres my code
if (strcmp("/dropgun", cmdtext, true, 10) == 0)
{
if(GetPlayerWeapon(playerid) == 0) return SendClientMessage(playerid,0xFF0000FF,"You haven't gun in Your hand.");
new name[MAX_PLAYER_NAME],msg[128],Float,Float:y,Float:z;
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
GetPlayerPos(playerid,x,y,z);
new WhatGun = GetPlayerWeapon(playerid);
new HowMuch = GetPlayerAmmo(playerid);
GivePlayerWeapon(playerid,WhatGun,-HowMuch);
format(msg,128,"%s has dropped his/her weapon on the floor.",name);
for(new i=0;i<MAX_PLAYERS;i++){
if(IsPlayerConnected(playerid)){
if(IsPlayerInRangeOfPoint(i,15,x,y,z)){
SendClientMessage(i,0xC2A2DAAA,msg);
}
}
}
return 1;
}