/putgun /takegun
#1

Hello !
I need strcmp (GF) commands /putgun and /takegun.Can my anyone give this command or help with it.


Sorry for my bad english and thanks
Reply
#2

I can't give you a strcmp but if you need zcmd just ask
Do you mean with something like IsPlayerInRangeOfPoint and /take and you get a gun?
Reply
#3

no i will put gun in interior and then take it are you understand ? wie puting gun in car you have 6 slots to put and then the gun save in car then on reconnect draw gun.
ok give me zcmd
Reply
#4

bumppp
Reply
#5

Код:
if(strcmp(cmd, "/giveweapon", true) == 0)
	{
	if(IsPlayerAdmin(playerid))
    {
    new var1, var2;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF4444FF, "[ERROR] Usage: /giveweapon [id] [WeaponID]");
    var1 = strval(tmp);

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF4444FF, "[ERROR] Usage: /giveweapon [id] [WeaponID]");
    var2 = strval(tmp);
    GivePlayerWeapon(var1,var2,2000);

    }
    else
    {
    SendClientMessage(playerid,0xFF4444FF,"* You can not use this command");
    }
    return 1;
    }
This gives a given ID a weapon.
  • var1 = The player ID
  • var2 = The weapon ID
  • The ammo = 2000

It checks if you are Rcon Admin.
And when you mean with "takegun" resetting the weapons of a player then just change the command above a bit and you are done.


Quote:

no i will put gun in interior and then take it are you understand ? wie puting gun in car you have 6 slots to put and then the gun save in car then on reconnect draw gun.
ok give me zcmd

Ouch I should start reading topics a bit more carefuly.
Reply
#6

not this i need commands to put and take gun in interior (playerpoint) for gangs how to create it ?
can anyone give me commands
Reply
#7

bump...
Reply
#8

Should be like this:

pawn Код:
if(strcmp(cmd, "/takegun", true) == 0)
{
   new tmp[256], tmp2[256]; // Tmp defines
   tmp = strtok(cmdtext, idx), tmp2 = (cmdtext, idx); // Tmp defines
   if(!strlen(tmp2)) SendClientMessage(playerid, COLOR_RED, "USAGE: /takegun [weaponid] [ammo]"); // Usage
   else if(IsPlayerInRangeOfPoint(playerid, 5, Xaxis, Yaxis, Zaxis)) // Use /save and find some co-ordiantes for these axis
   {
      GivePlayerWeapon(playerid, tmp, tmp2);
   }
   else SendClientMessage(playerid, COLOR_RED, "You need to be at a yourPostion to use this command!");
   return 1;
}
Reply
#9

Here you go: /putgun /takegun /gunerase
http://pastebin.com/6wrYd2W3
And the put this 'stock' and the colors the top somewhere:
pawn Код:
stock GetWeaponIDFromName(WeaponName[])
{
    if(strfind("molotov",WeaponName,true)!=-1)
    return 18;
    for(new i = 0; i <= 46; i++)
    {
    switch(i)
    {
    case 0,19,20,21,44,45: continue;
    default:
    {
    new name[32]; GetWeaponName(i,name,32);
    if(strfind(name,WeaponName,true) != -1)
    return i;
    }
    }
    }
    return -1;
}
colors here. (defined)
Reply
#10

Maybe that? If not, sorry...

Quote:

if(!strcmp(cmdtext, "/takegun", true))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are not logged in!");
return 1;
}
if(PlayerInfo[playerid][pInvWeapon] != 0 && PlayerInfo[playerid][pInvAmmo] != 0)
{
new gunname[100];
new str[255];
GetWeaponName(PlayerInfo[playerid][pInvWeapon], gunname, sizeof(gunname));
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo]);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You took an %S from the backpack!", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
format(str, sizeof(str), "* %s pulls out an %s from the backpack",sendername,gunname);
ProxDetector(25.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "In the backpack there are no weapons!");
return 1;
}
}
return 1;
}
if(!strcmp(cmdtext, "/putgun", true))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are not logged in!");
return 1;
}
if(PlayerInfo[playerid][pInvWeapon] != 0 || PlayerInfo[playerid][pInvAmmo] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "You have already put something in your backpack!");
return 1;
}
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
new str[256];
if(gunID != 0 && gunAmmo != 0)
{
PlayerInfo[playerid][pInvWeapon] = gunID;
PlayerInfo[playerid][pInvAmmo] = gunAmmo;
RemovePlayerWeapon(playerid, gunID);
GetPlayerName(playerid, sendername, sizeof(sendername));
new gunname[100];
GetWeaponName(gunID, gunname, sizeof(gunname));
format(string, sizeof(string), "You put %s in your backpack!", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
format(str, sizeof(str), "*%s puts %s in his backpack",sendername,gunname);
ProxDetector(25.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You have no weapons!");
return 1;
}
}
return 1;
}

Sorry for my bad translate :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)