Bugged
#1

Hello I made today ChopperGunner but its little bugged.When I type in Dialog ChopperGunner I spawn in Hunter and everything is ok.But when I leave Hunter pressing F It wont respawn.I add code when player leave vehicle to destroy vehicle also I kill timer but I dont know in what is problem

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(pChooperGunnerIN[playerid] == 1)return SendClientMessage(playerid,white,""embed_red"[ERROR]"embed_grey"You have been left you`re strike vehicle.You have been respawned!");
    {
        DestroyVehicle(pVeh);
        KillTimer(ChopperTimer);
        SetPlayerHealth(playerid,0);
    }
    return 1;
}
//Dialog
case 3:
            {
                new Float:X,Float:Y,Float:Z,string[128];
                pChooperGunner[playerid]--;
                GetPlayerPos(playerid,X,Y,Z);
                pVeh = CreateVehicle(425,X,Y,Z+150,0,-1,50,-1);
                PutPlayerInVehicle(playerid,pVeh,0);
                ChopperTimer = SetTimer("Chopper",45000,0);
                pChooperGunnerIN[playerid] = 1;
                GetPlayerName(playerid,pName,sizeof(pName));
                format(string,sizeof(string),"~r~%s has been dropped Chopper-Gunner!",pName);
                TextDrawSetString(DEV,string);
                TextDrawShowForAll(DEV);
                SetTimer("HideText",3000,0);
                SendClientMessage(playerid,white,""embed_yellow"[INFO]"embed_white"You have 45 seconds.Kill everybody!!");
            }
//Timer of Chopper
public Chopper(playerid)
{
    SetPlayerHealth(playerid,0);
    DestroyVehicle(pVeh);
    return 1;
}
Please help...
Reply
#2

Try
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(pChooperGunnerIN[playerid] == 1)return SendClientMessage(playerid,white,""embed_red"[ERROR]"embed_grey"You have been left you`re strike vehicle.You have been respawned!");
    {
        DestroyVehicle(vehicleid);
        KillTimer(ChopperTimer);
        SetPlayerHealth(playerid,0);
    }
    return 1;
}
Becouse on that public the player is exiting from "vehicleid"
Reply
#3

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Try
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(pChooperGunnerIN[playerid] == 1)return SendClientMessage(playerid,white,""embed_red"[ERROR]"embed_grey"You have been left you`re strike vehicle.You have been respawned!");
    {
        DestroyVehicle(vehicleid);
        KillTimer(ChopperTimer);
        SetPlayerHealth(playerid,0);
    }
    return 1;
}
Becouse on that public the player is exiting from "vehicleid"
This won`t work..
I add that DestroyVehicle(pVeh)
for:
pawn Код:
pVeh = CreateVehicle(425,X,Y,Z+150,0,-1,50,-1);
Reply
#4

Yes but you have
public OnPlayerExitVehicle(playerid, vehicleid)
He is exiting from vehicleid.
Just try it
Reply
#5

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Yes but you have
public OnPlayerExitVehicle(playerid, vehicleid)
He is exiting from vehicleid.
Just try it
I try it.Not working

Anyone Help
Reply
#6

Then try

Код:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicle);
And will destroy it only if he has
Код:
pChooperGunnerIN[playerid] = 1;
Reply
#7

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Then try

Код:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicle);
And will destroy it only if he has
Код:
pChooperGunnerIN[playerid] = 1;
??

Anyone please help...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)