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 12/07/2020, 05:02 AM
Replies: 8
Views: 211
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: 98
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: 104
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: 104
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: 13
Views: 731
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: 13
Views: 731
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: 13
Views: 731
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: 236
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: 203
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: 236
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: 73
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: 118
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: 464
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: 110
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: 87
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: 110
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: 162
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):

...
Forum: Scripting Help 23/06/2020, 07:11 PM
Replies: 6
Views: 162
Posted By NaS
Re: Detect object position

You can use VectorSize to get a distance between two points:

VectorSize(x1 - x2, y1 - y2, z1 - z2)

It will return the distance, then you can check if the distance is lower than the radius.
Forum: Scripting Help 22/06/2020, 12:16 PM
Replies: 2
Views: 99
Posted By NaS
Re: Door shouts

I don't know your House enum, but I assume there is a virtual world var as well for the interior?

See this:

if(GetPlayerVirtualWorld(p) != i)

It looks like it should be...
Forum: Scripting Help 21/06/2020, 07:40 PM
Replies: 2
Views: 92
Posted By NaS
Re: question about random

No, the random value will only be generated once, and then stored in the "prob" variable (and remain the same until it is changed to something else).

What you described would happen with a #define...
Forum: Scripting Help 18/06/2020, 07:06 PM
Replies: 1
Views: 89
Posted By NaS
Re: Error with colors

The color argument in SendClientMessage(ToAll) is not a string, it's an integer. So the color must be defined as follows:

#define COLOR_TP 0x01CDFEFF

and also needs 2 more digits for the alpha....
Forum: Scripting Help 17/06/2020, 07:46 PM
Replies: 6
Views: 166
Posted By NaS
Re: Mode spawn

Regarding the weapons, as long as you don't carry the DM weapons/armour over to freemode that should be fine.

You can't technically disable the class selection, but you can spawn the player as...
Forum: Scripting Help 17/06/2020, 03:47 PM
Replies: 17
Views: 364
Posted By NaS
Re: Same command to exit a dm zone

I will take CDM as an example, the same can be applied to the other DMs.

You are using && to call multiple functions in one line. But that is pretty unneccessary and also it can bring some issues....
Forum: Scripting Help 17/06/2020, 03:37 PM
Replies: 6
Views: 166
Posted By NaS
Re: Mode spawn

If I see it correctly, you call ProcessModeSpawn in OnPlayerSpawn and in SetPlayerMode (to set the position etc).
What I was trying to suggest is putting ProcessModeSpawn only in OnPlayerSpawn, and...
Forum: Scripting Help 17/06/2020, 01:38 PM
Replies: 6
Views: 166
Posted By NaS
Re: Mode spawn

You could try not calling ProcessModeSpawn in SetPlayerMode and instead respawn the player using SpawnPlayer (so that ProcessModeSpawn is only called in OnPlayerSpawn and won't result in an endless...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 07:18 PM.


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