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 04/08/2020, 06:47 PM
Replies: 6
Views: 223
Posted By NaS
Re: Npc driver is lagging

If you are laggy while recording, it will appear in the recording as well.
For the best results, record in an otherwise empty local server.
Forum: Scripting Help 28/07/2020, 03:45 PM
Replies: 7
Views: 183
Posted By NaS
Re: Server lagging OnplayerUpdate

A 10ms timer is literally worse than OPU.
Forum: Scripting Help 23/07/2020, 06:32 PM
Replies: 11
Views: 256
Posted By NaS
Re: Store in a variable when player stop handsup

https://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

The newkeys and oldkeys arguments in OnPlayerKeyStateChange are bitmasks that are set for individual keys. They basically contain all states of...
Forum: Scripting Help 23/07/2020, 07:53 AM
Replies: 1
Views: 93
Posted By NaS
Re: HTTP PROBLEM

https://www.w3schools.in/php/get-post/

That should cover most of your questions.

To send multiple values, seperate them with a &

?var1=value&var2=value&...
Forum: Scripting Help 17/07/2020, 03:21 PM
Replies: 6
Views: 234
Posted By NaS
Re: Should I update MySQL plugin to R40 above?

I guess it's just too much work at some point for no visible improvement. It's not like your players will ever notice the difference, so it's not a top priority as long as it still works.
...
Forum: Scripting Help 16/07/2020, 06:08 PM
Replies: 15
Views: 742
Posted By NaS
Re: Saving&Loading 100 Variables

You are not using the INI_Int and INI_WriteInt functions correctly.

The string you are formatting is the name of the entry in the INI file. However, you include both the index and value in it and...
Forum: Scripting Help 15/07/2020, 11:43 AM
Replies: 3
Views: 182
Posted By NaS
Re: Title[MAX_TITLES][128] in Enum

Multidimensional arrays don't work in multidimensional enumerated arrays. They should theoretically - at least in the community compiler version - but they mostly still don't.

Are all of the...
Forum: Scripting Help 15/07/2020, 11:32 AM
Replies: 6
Views: 265
Posted By NaS
Re: No nametag id only

Please use or [php] tags to show code. It also helps a lot posting the response of the compiler (and marking the error line).

You passed playerid to the "text" argument which is a string.

The...
Forum: Scripting Help 12/07/2020, 05:02 AM
Replies: 8
Views: 274
Posted By NaS
Re: About difference

It's worth it in some cases, for example when having large data arrays in an include with lots of constant strings. You will usually have a function that gets the string(s) from the array into a...
Forum: Scripting Help 11/07/2020, 06:40 PM
Replies: 2
Views: 130
Posted By NaS
Re: Interpolate camera pos

When the player enters the checkpoint, you can use the interpolate functions to move the camera. At the same time, you set a timer with the duration of the camera animation to a new public function....
Forum: Scripting Help 07/07/2020, 09:38 AM
Replies: 4
Views: 120
Posted By NaS
Re: Amx backtrace over my powers...

There are two strings you are formating at the start of OnPlayerDeath, both use GetName(killerid) without any checks.
Forum: Scripting Help 07/07/2020, 09:19 AM
Replies: 4
Views: 120
Posted By NaS
Re: Amx backtrace over my powers...

You are using killerid in OnPlayerDeath without verifying it is valid. It is called with INVALID_PLAYER_ID (65535) if a player dies without getting killed by someone else (see #2 (hook) and #4,...
Forum: Filterscripts 03/07/2020, 05:57 PM
Replies: 14
Views: 1,262
Posted By NaS
Re: Kill Assist [killAssist.fs]

Consider this array content for some player:

0: 20
1: 21
2: 25
3: INVALID_PLAYER_ID (free)
4: 22

If you run the old loop with issuerid = 22 you would expect it to do nothing, as 22 is...
Forum: Filterscripts 03/07/2020, 04:59 PM
Replies: 14
Views: 1,262
Posted By NaS
Re: Kill Assist [killAssist.fs]

If a slot is empty (say slot 1) and the player is already in slot 2, the loop will stop at slot 1 and insert. This will lead to the player being in slot 1 and 2 since the loop never reached slot 2 to...
Forum: Filterscripts 03/07/2020, 03:41 PM
Replies: 14
Views: 1,262
Posted By NaS
Re: Kill Assist [killAssist.fs]

You should probably clear the assists for any player who leaves the server, otherwise it will give assists to players who didn't actually assist if someone rejoins with the same ID.

Furthermore,...
Forum: Scripting Help 01/07/2020, 07:30 PM
Replies: 4
Views: 255
Posted By NaS
Re: How to get z ground from roof building

Technically that is correct, but it applies to other structures as well (for example a brigde or hill over a road). So the Z difference alone is not a sufficient criteria I think.

For a start you...
Forum: Includes 01/07/2020, 06:42 PM
Replies: 0
Views: 417
Posted By NaS
Object Texture Data

A small but handy include that contains data about object textures. It includes 2 arrays:

- Each model's amount of materials (useful for editors to determine which material indexes are valid)
-...
Forum: Scripting Help 30/06/2020, 01:48 PM
Replies: 4
Views: 255
Posted By NaS
Re: How to get z ground from roof building

The collision data does not contain info whether or not a surface is ground or building. Even the pathfinder doesn't know what's the actual ground or top of a building, it just detects height...
Forum: Scripting Help 29/06/2020, 09:40 AM
Replies: 1
Views: 86
Posted By NaS
Re: Loading Texture name - SetObjectMaterial

The text contains quotation marks, see:

"\"bdupsnew\""

You need to remove both \" from each string since they are not part of the actual model names.
Forum: Scripting Help 27/06/2020, 08:26 PM
Replies: 2
Views: 129
Posted By NaS
Re: Get player direction from other player by camera

You could get the camera's Z angle using the GetZAngle (or atan2) function and then subtract the player-to-player angle from it. That should give you the rotation relative to the camera.

I would...
Forum: Scripting Help 25/06/2020, 05:51 PM
Replies: 21
Views: 516
Posted By NaS
Re: Problem houses

It's generally a good idea not to use the MySQL ID as ID for the array. That way you can keep auto increment even if it goes past the array size. When loading a house, find a free slot in the array...
Forum: Scripting Help 25/06/2020, 02:20 PM
Replies: 3
Views: 122
Posted By NaS
Re: Object position not changing

There can be some sync issues when there are more players nearby. It can be tricky I think, but it should be possible to do.
Forum: Scripting Help 25/06/2020, 02:17 PM
Replies: 2
Views: 104
Posted By NaS
Re: Streamer Visibility PROBLEM

There is a feature in the streamer plugin that updates the items only if the player moves. This is to save some performance but has the side effect that moving objects don't stream in while players...
Forum: Scripting Help 24/06/2020, 07:38 PM
Replies: 3
Views: 122
Posted By NaS
Re: Object position not changing

It is not possible to detect client side position changes. The object's position is not synced back to the server, so that function will only get the position the server has stored.
Forum: Scripting Help 23/06/2020, 08:12 PM
Replies: 6
Views: 183
Posted By NaS
Re: Detect object position

The variable does not need to be an array, a regular local var is enough if you use it in a function, similar to this function (note in this function radius comes before the position):

...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 08:50 PM.


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