SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 500
Search took 0.03 seconds.
Search: Posts Made By: NaS
Forum: Scripting Help 03/04/2020, 06:50 AM
Replies: 15
Views: 149
Posted By NaS
Re: Could the "Tag mismatch" crash server?

Why create multiple variables for different fuel types when a vehicle can use only one fuel type anyway.

You can still use an enum to define the fuel types, but store the fuel type for vehicles in...
Forum: Scripting Help 02/04/2020, 04:31 PM
Replies: 5
Views: 82
Posted By NaS
Re: FCNPC created in 0 vw and interior when it shouldn't

Since 2.0 you should move all code related to settings/weapons/v.world etc to FCNPC_OnCreate, it seems more reliable (even though it usually works anywhere, it sometimes crashes or glitches when you...
Forum: Scripting Help 29/03/2020, 05:52 PM
Replies: 7
Views: 119
Posted By NaS
Re: MySQL R41-4, saving player weapon data

GetPlayerWeaponData gets the weapon and ammo by reference, that means it will write the values to the two last parameters (variables) you passed to it (Player[playerid][Weapon1],...
Forum: Scripting Help 27/03/2020, 08:12 PM
Replies: 11
Views: 163
Posted By NaS
Re: HTML to ARGB Conversion

There are a few other EnEx markers with different animations and colors, not sure which one is non-animated but you should be able to find them on the wiki: https://wiki.sa-mp.com/wiki/Samp_objects...
Forum: Scripting Help 27/03/2020, 07:55 PM
Replies: 11
Views: 163
Posted By NaS
Re: HTML to ARGB Conversion

col = ConvertRGBAToARGB(col);

or

return ConvertRGBAToARGB(col);

The function returns the new color.
Forum: Filterscripts 27/03/2020, 07:53 PM
Replies: 220
Views: 59,470
Posted By NaS
Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

The links for the plugins and includes are in the topic. I changed the rotations link to the 1.2.0 version.

For FC NPC I cannot link it here, it is censored, but I suggest you use version 2.0.0...
Forum: Scripting Help 27/03/2020, 07:36 PM
Replies: 11
Views: 163
Posted By NaS
Re: HTML to ARGB Conversion

I assume the input (MarkerInfo[mode][ID][Color]) is RGBA? Or was that already converted from rgba to argb?
sscanf does not change the order of the channels, it only converts from string to integer....
Forum: Scripting Help 27/03/2020, 07:27 PM
Replies: 11
Views: 163
Posted By NaS
Re: HTML to ARGB Conversion

Could you show the code you currently have? The alpha value should remain untouched.
Did you verify that ConvertStringToARGB correctly converts it by outputting the string somewhere (same goes for...
Forum: Scripting Help 27/03/2020, 05:30 PM
Replies: 11
Views: 163
Posted By NaS
Re: HTML to ARGB Conversion

I think that only works for integers, not strings.

You can use sscanf:

new color;
sscanf(color_string, "x", color);

If you give it aarrggbb as string it will also be aarrggbb as integer....
Forum: Scripting Help 27/03/2020, 02:56 PM
Replies: 5
Views: 60
Posted By NaS
Re: Setting CheckPoint when Player enters a vehicle

I meant you use the code you currently have, and add the newstate check to it. That way it will execute only for drivers that enter a Landstalker.


public OnPlayerStateChange(playerid, newstate,...
Forum: Scripting Help 27/03/2020, 02:53 PM
Replies: 5
Views: 60
Posted By NaS
Re: Setting CheckPoint when Player enters a vehicle

I'd suggest using OnPlayerStateChange and check if the newstate is equal to PLAYER_STATE_DRIVER (the rest is the same). OnPlayerEnterVehicle is called when you press F near the vehicle, and sometimes...
Forum: Scripting Help 27/03/2020, 01:52 PM
Replies: 1
Views: 50
Posted By NaS
Re: Detect when camera stops moving

Since InterpolateCameraPos/Look at move the camera for the duration you specifiy, I think a timer would make more sense.

But there is also GetPlayerCameraPos you could use to check the camera...
Forum: Filterscripts 27/03/2020, 01:32 PM
Replies: 220
Views: 59,470
Posted By NaS
Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

What do you mean exactly with full version? You mean the compiled amx or the plugins?
Forum: Discussion 27/03/2020, 11:39 AM
Replies: 1
Views: 86
Posted By NaS
Re: What about Moving-Object Timers?

Theoretically you can, but you would waste object slots. They also do not remain as accurate as timers if the server is under stress - objects will start to move slightly slower than on the client...
Forum: Scripting Help 27/03/2020, 10:45 AM
Replies: 7
Views: 143
Posted By NaS
Re: Everyone on the server crashes in the exact same area

Check which maps are in that area. Most likely the amount of objects is too high (or too many different ones).

You could try to reduce the number of visible objects for players using...
Forum: Scripting Help 26/03/2020, 01:24 AM
Replies: 4
Views: 92
Posted By NaS
Re: Plugin? Include?

You can try this include: https://gist.github.com/Naseband/1bc9a533604daf9d0ed0a547791123e0

But it's not finished. When autoupdating the route, it is recreated constantly even if parts of the...
Forum: Scripting Help 25/03/2020, 01:50 PM
Replies: 11
Views: 184
Posted By NaS
Re: [Problem] setplayerobjectmaterialtext with getplayerspeed

Does IsPlayerNearObject use GetObjectPos or GetDynamicObjectPos? It's created as dynamic object so make sure it uses the latter.
Forum: Scripting Help 21/03/2020, 05:37 PM
Replies: 11
Views: 234
Posted By NaS
Re: Actors Sync Problem

Oh alright.

I just tested a bit and with the code you use it works accurately on R4, but not on R2. Switching to R4 might be the best solution but players on R2 will still see wrong rotations.
...
Forum: Scripting Help 21/03/2020, 04:55 PM
Replies: 11
Views: 234
Posted By NaS
Re: Actors Sync Problem

Add a printf or so to see if the angle is correct (test east, west, south etc), though the code looks ok.

If the angles are correct it's probably the actor not rotating exactly where it should....
Forum: Scripting Help 21/03/2020, 04:17 PM
Replies: 11
Views: 234
Posted By NaS
Re: Actors Sync Problem

I think the method you are using is a bit inaccurate (may just be related to that). An easier way to calculate the angle between two points is this:

angle = atan2(y2 - y1, x2 - x1) - 90.0;

x1,...
Forum: Filterscripts 19/03/2020, 05:29 PM
Replies: 6
Views: 218
Posted By NaS
Re: PLEASE HELP! (88) : error 035: argument type mismatch (argument 3)

If you want to show values (like wantedlevel) in text you need to format it into a string first:

new text[30];
format(text, sizeof(text), "Wanted Level: %d", wantedlevel);...
Forum: Scripting Help 19/03/2020, 05:19 PM
Replies: 6
Views: 168
Posted By NaS
Re: How to calculate TextDrawTextSize?

You need to calculate the amount of lines each text has, then multiply that by the height of one line to get the total height of a textdraw.

To calculate the number of lines for a textdraw you can...
Forum: Scripting Help 18/03/2020, 04:36 PM
Replies: 3
Views: 73
Posted By NaS
Re: ERRORS!!

format(string, sizeof(string), ""ORANGE"> "WHITE"C-Bug\t%s\n", (DuelInfo[id][duelCBug] ? (""GREEN"Enabled") : (""RED"Disabled")));

The strings must be surrounded by brackets, the same goes for...
Forum: Scripting Help 18/03/2020, 11:34 AM
Replies: 3
Views: 120
Posted By NaS
Re: Is YSF Plugin safe?

Using only YSF (no sky) it seems stable. The only issue I experience is that dynamic objects that are attached to other dynamic objects sometimes attach to the wrong object when the parent unstreams....
Forum: Scripting Help 17/03/2020, 10:16 AM
Replies: 3
Views: 97
Posted By NaS
Re: Samp Object ID

18674 attached with a low scale

https://wiki.sa-mp.com/wiki/Samp_objects#Particle_Effects
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 05:42 PM.


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