CMD:tazer
#1

Hey ya'll, Im havin' a bit of trouble with my /tazer command. Whenever i use the command its fine.. It tazes the guy perfectly.. but when i /tazer again... My weapons show up... but i cant use them.. Like when you attempt to scroll to it, it just disappears.. Cant have that now can we! If you happen to know, please help me a bit ere', thank ya!

Код:
CMD:tazer(playerid, params[])
{
	new string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) && !IsASoldier(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an FCPD Officer.");
	if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while being in a vehicle.");
	if(!Tazer[playerid])
	{
	    Tazer[playerid] = 1;
	    format(string, sizeof(string), "* %s takes out their tazer from their holster and loads it.", RPN(playerid));
	    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	    if(PlayerInfo[playerid][pWeapon][2] == 24)
	    {
			ReplaceTazer[playerid] = 1;
			GetPlayerWeaponData(playerid, 2, OldGun[playerid], OldAmmo[playerid]);
			SendClientMessage(playerid, COLOR_WHITE, "Your desert eagle will be given back when you holster your tazer.");
	    }
	    GunsBeingRemoved[playerid] = 1;
	    RemoveZaiatWeapon(playerid, 24);
	    GunsBeingRemoved[playerid] = 1;
	    GiveZaiatWeapon(playerid, 23, 500);
	    GunsBeingRemoved[playerid] = 1;
    }
    else
    {
        Tazer[playerid] = 0;
        RemoveZaiatWeapon(playerid, 23);
   		format(string, sizeof(string), "* %s unloads their tazer and puts it back to their holster.", RPN(playerid));
	    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	    if(ReplaceTazer[playerid])
        {

            ReplaceTazer[playerid] = 0;
            GunsBeingRemoved[playerid] = 1;
            GiveZaiatWeapon(playerid, OldGun[playerid], OldAmmo[playerid]);
            GunsBeingRemoved[playerid] = 1;
            OldGun[playerid] = 0;
            OldAmmo[playerid] = 0;
            SendClientMessage(playerid, COLOR_WHITE, "You have recieved your desert eagle back as you've holstered your tazer.");
        }
    }
	return 1;
}
Reply
#2

Try this (UNTESTED.)
Код:
CMD:tazer(playerid, params[])
{
	new string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) && !IsASoldier(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an FCPD Officer.");
	if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while being in a vehicle.");
	if(!Tazer[playerid])
	{
	    Tazer[playerid] = 1;
	    format(string, sizeof(string), "* %s takes out their tazer from their holster and loads it.", RPN(playerid));
	    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	    if(PlayerInfo[playerid][pWeapon][2] == 24)
	    {
			ReplaceTazer[playerid] = 1;
			GetPlayerWeaponData(playerid, 2, OldGun[playerid], OldAmmo[playerid]);
			SendClientMessage(playerid, COLOR_WHITE, "Your desert eagle will be given back when you holster your tazer.");
	    }
	    GunsBeingRemoved[playerid] = 1;
	    RemoveZaiatWeapon(playerid, 24);
	    GunsBeingRemoved[playerid] = 1;
	    GiveZaiatWeapon(playerid, 23, 500);
	    GunsBeingRemoved[playerid] = 1;
    }
    else
    {
        Tazer[playerid] = 0;
        RemoveZaiatWeapon(playerid, 23);
   		format(string, sizeof(string), "* %s unloads their tazer and puts it back to their holster.", RPN(playerid));
	    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	    if(ReplaceTazer[playerid])
        {

            ReplaceTazer[playerid] = 0;
            GunsBeingRemoved[playerid] = 0;
            GiveZaiatWeapon(playerid, OldGun[playerid], OldAmmo[playerid]);
            GunsBeingRemoved[playerid] = 0;
            OldGun[playerid] = 0;
            OldAmmo[playerid] = 0;
            SendClientMessage(playerid, COLOR_WHITE, "You have recieved your desert eagle back as you've holstered your tazer.");
        }
    }
	return 1;
}
Reply
#3

Still nothing Partner, Anyone else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)