Teleporting Weapons
#1

I wish to make a pretty basic command that when you shoot a specific weapon, it does a special action. I tried first with shotgun that when you shot in a location, it TPs you there:
PHP код:
CMD:magicweaps(playerid,params[])
{
    new 
path[256];
    
format(path,sizeof(path),"users/%s.ini",PlayerName(playerid));
    if(
IsPlayerAdmin(playerid) || dini_Int(path,"Admin Level") >= 3)
    {
        if(
plInfo[playerid][tpw] == true)
        {
            
plInfo[playerid][tpw] = false;
            
SendClientMessage(playerid,COLOR_GREEN,"You turned on magic weapons!");
        }
        else
        {
            
plInfo[playerid][tpw] = true;
            
SendClientMessage(playerid,COLOR_RED,"You turned off magic weapons!");
        }
    }
    return 
1;
}
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
path[256];
    
format(path,sizeof(path),"users/%s.ini",PlayerName(playerid));
    if(
IsPlayerAdmin(playerid) || dini_Int(path,"Admin Level") >= 3)
    {
        if(
plInfo[playerid][tpw] == true)
        {
            if(
hittype == BULLET_HIT_TYPE_NONE)
            {
                if(
weaponid == 25SetPlayerPos(playerid,fX,fY,fZ);
            }
        }
    }
    return 
1;

And then nothing happens, just casual shooting.
Reply


Messages In This Thread
Teleporting Weapons - by PizzaMag - 03.04.2018, 23:00
Re: Teleporting Weapons - by ForCop - 04.04.2018, 07:14
Re: Teleporting Weapons - by PizzaMag - 04.04.2018, 15:53
Re: Teleporting Weapons - by ForCop - 04.04.2018, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)