30.03.2014, 14:58
How to save weapons slot number 2 to veriable?
#define MAX_WEAPONS 12
new WeaponInfo[MAX_PLAYERS][MAX_WEAPONS];
WeaponInfo[playerid][2] = weaponid;
#define MAX_WEAPONS 12
new WeaponInfo[MAX_PLAYERS][MAX_WEAPONS];
new WeaponAmmo[MAX_PLAYERS][MAX_WEAPONS];
WeaponInfo[playerid][2] = weaponid;
WeaponAmmo[playerid][2] = ammo;
new weapons[13][2]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); }
if(strcmp(cmdtext, "/tazer", true) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You are currently in a vehicle!");
return 1;
}
if(strfind(name, "[PD]", true) == -1)
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command.");
return 1;
}
new gunID = GetPlayerWeapon(playerid);
new Amm = GetPlayerAmmo(playerid);
WeaponInfo[playerid][2] = gunID;
WeaponAmmo[playerid][2] = Amm;
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
if(weapons[2][0] == 23) { WEAPON = 23; }
if(HasTazer[playerid] == 0)
{
GiveTazer(playerid);
GivePlayerWeapon(playerid, WEAPON, 50);
return 1;
}
if(HasTazer[playerid] == 1)
{
GivePlayerWeapon(playerid, gunID, Amm);
TakeTazer(playerid);
return 1;
}
return 1;
}
return 0;
}