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; }
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 |
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;
}
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;
}
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; } |