playerid in OnVehicleDeath
#1

I want to kill the vehicle only in Deathm. But only vehicleid, killerid params are valid.

Код HTML:
if(GetPVarInt(playerid,"Deathm"))
	{
		DestroyVehicle(vehicleid);
	}
Код:
public OnVehicleDeath( vehicleid, killerid )
{
	if(GetPVarInt(playerid,"Deathm"))
	{
		DestroyVehicle(vehicleid);
	}
	
    return ( 1 );
}
Reply
#2

new vehicleid = GetPlayerVehicleId(playerid)
Reply
#3

Hmm.. This one im talking about

Код HTML:
if(GetPVarInt(playerid,"Deathm"))
Reply
#4

PHP код:
public OnVehicleDeathvehicleidkillerid )
{
    if(
GetPVarInt(playerid,"Deathm"))
    {
        
DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    
    return 
1;

and i would suggest you to use arrays not pvars arrays use less memory and faster!
Reply
#5

Quote:
Originally Posted by Deadpoop
Посмотреть сообщение
PHP код:
public OnVehicleDeathvehicleidkillerid )
{
    if(
GetPVarInt(playerid,"Deathm"))
    {
        
DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    
    return 
1;

and i would suggest you to use arrays not pvars arrays use less memory and faster!
Thanks but error.

Код HTML:
error 017: undefined symbol "playerid"
error 017: undefined symbol "playerid"
the parameters
public OnVehicleDeath( vehicleid, killerid )
Reply
#6

Quote:
Originally Posted by OKOK
Посмотреть сообщение
I want to kill the vehicle only in Deathm. But only vehicleid, killerid params are valid.

Код HTML:
if(GetPVarInt(playerid,"Deathm"))
	{
		DestroyVehicle(vehicleid);
	}
Код:
public OnVehicleDeath( vehicleid, killerid )
{
	if(GetPVarInt(playerid,"Deathm"))
	{
		DestroyVehicle(vehicleid);
	}
	
    return ( 1 );
}
Replace "playerid" with "killerid". I'll also agree about arrays as well.
Reply
#7

then do it onplayerdeath

PHP код:
public OnPlayerDeath(playeridkillerid)
{
    if(
GetPVarInt(playerid,"Deathm"))
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            
DestroyVehicle(GetPlayerVehicleID(playerid));
   }
   return 
1;

Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Replace "playerid" with "killerid". I'll also agree about arrays as well.
That will destroy the vehicle of the killer not the one that died!
Reply
#9

Quote:
Originally Posted by Deadpoop
Посмотреть сообщение
then do it onplayerdeath

PHP код:
public OnPlayerDeath(playeridkillerid)
{
    if(
GetPVarInt(playerid,"Deathm"))
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            
DestroyVehicle(GetPlayerVehicleID(playerid));
   }
   return 
1;

lol clever

but i'm worrying if player a player jumps off the car. he is not in a vehicle anymore that time. but I think i'll use this for now. thanks tho.

if anyone can maneuver playerid on onvehicledeath then that would be cool! lol
Reply
#10

Код:
public OnVehicleDeath(vehicleid, killerid) 
{ 
     foreach(new i : Player)
     {
          if(GetPVarInt(i,"Deathm")) 
         { 
        
                    DestroyVehicle(vehicleid); 
break;
              
         }
    } 
    return 1; 
}
Reply


Forum Jump:


Users browsing this thread: