SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/01/2018, 07:18 PM   #4521
Infra
Big Clucker
 
Infra's Avatar
 
Join Date: Feb 2014
Location: Germany
Posts: 85
Reputation: 19
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Garavel View Post
I somehow managed to make all the cars in my gamemode invincible against bullet damage. They take collision damage fine but they ignore bullets... Can't remember what I did that might cause that. I run a TDM server so it is pretty important Anyone have any idea what might be causing this? I know it is not setvehiclehealth, because I don't use it at all.
Try that:

pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == BULLET_HIT_TYPE_VEHICLE)
        return false;
    return true;
}

Quote:
This callback is only called when lag compensation is enabled.
Infra is offline   Reply With Quote
Old 19/01/2018, 03:55 AM   #4522
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 590
Reputation: 34
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by BanhVo View Post
I still can not open it. I want to take the Faction Dog open. I made it into filterscripts. Help me .
Dog?
People are getting creative.
__________________
coool is offline   Reply With Quote
Old 19/01/2018, 10:57 AM   #4523
Garavel
Little Clucker
 
Garavel's Avatar
 
Join Date: Jan 2015
Posts: 35
Reputation: 2
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Infra View Post
Try that:

pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == BULLET_HIT_TYPE_VEHICLE)
        return false;
    return true;
}
Doesn't that make sure no vehicle is damaged though?
I need the opposite, I need the vehicles to do take damage from bullets
Garavel is offline   Reply With Quote
Old 19/01/2018, 12:20 PM   #4524
Infra
Big Clucker
 
Infra's Avatar
 
Join Date: Feb 2014
Location: Germany
Posts: 85
Reputation: 19
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Garavel View Post
Doesn't that make sure no vehicle is damaged though?
I need the opposite, I need the vehicles to do take damage from bullets
Got your post wrong , wops
Infra is offline   Reply With Quote
Old 19/01/2018, 05:26 PM   #4525
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,927
Reputation: 256
Default Re: Little coding questions - For general minor queries 5

CreateActor and CreateDynamicActor follow the same id incrementation or it's separate?
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is online now   Reply With Quote
Old 19/01/2018, 05:41 PM   #4526
ThePhenix
Gangsta
 
ThePhenix's Avatar
 
Join Date: May 2012
Posts: 823
Reputation: 157
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Dayrion View Post
CreateActor and CreateDynamicActor follow the same id incrementation or it's separate?
It's a different ID increment.
ThePhenix is offline   Reply With Quote
Old 19/01/2018, 06:08 PM   #4527
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,927
Reputation: 256
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by ThePhenix View Post
It's a different ID increment.
Yes, still weird. Sometimes it does, sometimes it doesn't or it's maybe my code ahah
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is online now   Reply With Quote
Old 10/02/2018, 12:24 PM   #4528
GaByM
Big Clucker
 
GaByM's Avatar
 
Join Date: Jan 2014
Location: Romania
Posts: 112
Reputation: 10
Default Re: Little coding questions - For general minor queries 5

Is there any problems if I do this?

PHP Code:
CreateVehicleEx__(typeFloat:xFloat:yFloat:zFloat:ac1c2respawn=300addsiren=0)
{
    new 
q;
    if((
CreateVehicle(typexyzac1c2respawnaddsiren)) == INVALID_VEHICLE_ID) return INVALID_VEHICLE_ID;

    
CallLocalFunction("OnVehicleCreate""iiffffiiii"qtypexyzac1c2respawnaddsiren);
    return 
q;
}
#if defined _ALS_CreateVehicle
    #undef CreateVehicle
#else
    #define _ALS_CreateVehicle
#endif
#define CreateVehicle CreateVehicleEx__

// later..

#include <YSI\y_hooks>
hook OnVehicleCreate(vehicleid)
{
        
// i don't need info about vehicle's spawn pos here, so there is just vehicleid as parameter.

I know it works and it compiles, but can this cause memory leaks / other problems?

EDIT: or if I use SetTimerEx instead of CallLocalFunction
GaByM is offline   Reply With Quote
Old 12/02/2018, 07:21 PM   #4529
GaByM
Big Clucker
 
GaByM's Avatar
 
Join Date: Jan 2014
Location: Romania
Posts: 112
Reputation: 10
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by GaByM View Post
Is there any problems if I do this?

PHP Code:
CreateVehicleEx__(typeFloat:xFloat:yFloat:zFloat:ac1c2respawn=300addsiren=0)
{
    new 
q;
    if((
CreateVehicle(typexyzac1c2respawnaddsiren)) == INVALID_VEHICLE_ID) return INVALID_VEHICLE_ID;

    
CallLocalFunction("OnVehicleCreate""iiffffiiii"qtypexyzac1c2respawnaddsiren);
    return 
q;
}
#if defined _ALS_CreateVehicle
    #undef CreateVehicle
#else
    #define _ALS_CreateVehicle
#endif
#define CreateVehicle CreateVehicleEx__

// later..

#include <YSI\y_hooks>
hook OnVehicleCreate(vehicleid)
{
        
// i don't need info about vehicle's spawn pos here, so there is just vehicleid as parameter.

I know it works and it compiles, but can this cause memory leaks / other problems?

EDIT: or if I use SetTimerEx instead of CallLocalFunction

1. ^^^

2. mysql log-core.log:
Code:
[ERROR] signal 11 (SIGSEGV) catched; shutting log-core down (errno: 0, signal code: 1, exit status: 1)
What does this means?
GaByM is offline   Reply With Quote
Old 28/02/2018, 04:25 PM   #4530
GospodinX
Big Clucker
 
Join Date: Nov 2017
Posts: 120
Reputation: 20
Default Re: Little coding questions - For general minor queries 5

Do I need to hide textdraws onplayerdisconnect?
GospodinX 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
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 2 05/10/2009 07:47 PM


All times are GMT. The time now is 04:51 PM.


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