SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/05/2012, 08:29 PM   #1
SpiderWalk
High-roller
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 1,121
Reputation: 26
Default Bugged

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 Code:
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...
SpiderWalk is offline   Reply With Quote
Old 04/05/2012, 08:32 PM   #2
TzAkS.
Gangsta
 
TzAkS.'s Avatar
 
Join Date: Mar 2012
Location: Greece
Posts: 571
Reputation: 66
Default Re: Bugged

Try
Code:
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"
TzAkS. is offline   Reply With Quote
Old 04/05/2012, 08:37 PM   #3
SpiderWalk
High-roller
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 1,121
Reputation: 26
Default Re: Bugged

Quote:
Originally Posted by TzAkS. View Post
Try
Code:
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 Code:
pVeh = CreateVehicle(425,X,Y,Z+150,0,-1,50,-1);
SpiderWalk is offline   Reply With Quote
Old 04/05/2012, 08:39 PM   #4
TzAkS.
Gangsta
 
TzAkS.'s Avatar
 
Join Date: Mar 2012
Location: Greece
Posts: 571
Reputation: 66
Default Re: Bugged

Yes but you have
public OnPlayerExitVehicle(playerid, vehicleid)
He is exiting from vehicleid.
Just try it
TzAkS. is offline   Reply With Quote
Old 04/05/2012, 08:43 PM   #5
SpiderWalk
High-roller
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 1,121
Reputation: 26
Default Re: Bugged

Quote:
Originally Posted by TzAkS. View Post
Yes but you have
public OnPlayerExitVehicle(playerid, vehicleid)
He is exiting from vehicleid.
Just try it
I try it.Not working

Anyone Help
SpiderWalk is offline   Reply With Quote
Old 04/05/2012, 08:51 PM   #6
TzAkS.
Gangsta
 
TzAkS.'s Avatar
 
Join Date: Mar 2012
Location: Greece
Posts: 571
Reputation: 66
Default Re: Bugged

Then try

Code:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicle);
And will destroy it only if he has
Code:
pChooperGunnerIN[playerid] = 1;
TzAkS. is offline   Reply With Quote
Old 04/05/2012, 09:25 PM   #7
SpiderWalk
High-roller
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 1,121
Reputation: 26
Question Re: Bugged

Quote:
Originally Posted by TzAkS. View Post
Then try

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

Anyone please help...
SpiderWalk is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDs Bugged Mandro Scripting Help 4 12/12/2011 01:44 PM
Bugged CMD manchestera Scripting Help 10 28/10/2011 08:32 PM
SA:MP 0.3b BUgGED!!!!!!! ColdXX Client Support 5 29/08/2010 10:09 PM
PAWNcompiler bugged or PAWNO bugged? Gamer_Z Help Archive 6 06/08/2010 09:02 AM
/v bugged ColdXX Help Archive 2 14/04/2010 04:31 PM


All times are GMT. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.