SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 500
Search took 0.02 seconds.
Search: Posts Made By: NaS
Forum: Scripting Help 25/09/2018, 08:28 PM
Replies: 2
Views: 23
Posted By NaS
Re: crashdetect

This means that those functions do not exist. You're missing a plugin.
Forum: Scripting Help 22/09/2018, 04:00 PM
Replies: 3
Views: 113
Posted By NaS
Re: How I can do this?

That's not the same. Pathfinder will not only consider roads.

The server probably uses the GPS Plugin + YSF. Using YSF you can display the route via Player-GangZones.
Forum: Scripting Help 22/09/2018, 02:05 PM
Replies: 14
Views: 259
Posted By NaS
Re: Command

Of course it doesn't. MapAndreas didn't load. Did you place the hmap file into scriptfiles and call MapAndreas_Init? If you have the full hmap you must load it with mode 2 iirc. Check the topic for...
Forum: Scripting Help 22/09/2018, 01:03 PM
Replies: 14
Views: 259
Posted By NaS
Re: Command

Debug the values and see what comes out. The same code worked for me.
Does MapAndreas work (return someting else than 0.0)?
Forum: Scripting Help 22/09/2018, 12:26 PM
Replies: 14
Views: 259
Posted By NaS
Re: Command

Change it to 'oz' in the above code...
Forum: Scripting Help 22/09/2018, 04:48 AM
Replies: 3
Views: 74
Posted By NaS
Re: Last kill does not work

I'm not sure if you intentionally changed the order of arguments of SendClientMessageEx, but usually SendClientMessage should be called like this:

SendClientMessageEx(playerid, COLOR_YELLOW,...
Forum: Scripting Help 21/09/2018, 05:13 PM
Replies: 10
Views: 174
Posted By NaS
Re: NPC chase the nearest player

By default there are Iterators for Players and NPCs. Check the foreach include, there should be definitions for both (also defines).
But even if there aren't you can always declare your own Iterator...
Forum: Scripting Help 21/09/2018, 02:41 PM
Replies: 10
Views: 174
Posted By NaS
Re: NPC chase the nearest player

This code does not determine the closest player.

It will select everyone in range as target, the highest playerid will then be the final target as it is set last.

To make it actually search for...
Forum: Scripting Help 21/09/2018, 02:29 PM
Replies: 14
Views: 259
Posted By NaS
Re: Command

You should add a small tolerance, because a) MapAndreas isn't 100% precise and b) the player position will always be above the ground (exactly 1 unit above ground, which is the origin of the player...
Forum: Scripting Help 21/09/2018, 02:14 PM
Replies: 10
Views: 174
Posted By NaS
Re: NPC chase the nearest player

Could you post the related code? Otherwise we have to guess what could be the cause :)
Forum: Plugin Development 21/09/2018, 01:06 PM
Replies: 22
Views: 2,440
Posted By NaS
Re: Local Keys Plugin

For this plugin a playerid parameter doesn't really make sense, since it's not bound to a specific player, just the local machine (even if SAMP isn't running).

Regarding the other plugin I still...
Forum: Plugin Development 20/09/2018, 11:57 PM
Replies: 22
Views: 2,440
Posted By NaS
Re: Local Keys Plugin

Updated.

Added GetCursorPos() and SetCursorPos().
Forum: Scripting Help 20/09/2018, 11:14 PM
Replies: 13
Views: 379
Posted By NaS
Re: select player random

new president = Iter_Random(EventPlayers), vice_president;

do
{
vice_president = Iter_Random(EventPlayers);
}
while(president == vice_president);


This will select a random president...
Forum: Scripting Help 20/09/2018, 08:15 PM
Replies: 13
Views: 192
Posted By NaS
Re: mysql server stats

Insert one. If it's meant to always exist you can just do this in phpmyadmin. Or just add a non-threaded query in OnGameModeInit to check if they exist, and if they don't insert a new row.
Forum: Scripting Help 20/09/2018, 07:35 PM
Replies: 5
Views: 103
Posted By NaS
Re: AttachCameraToObject offset?

19300 is an empty model for that purpose.
Forum: Scripting Help 20/09/2018, 07:33 PM
Replies: 2
Views: 114
Posted By NaS
Re: shift positions inside of an array?

A simple loop.

for(new i = sizeof(array) - 1; i > 0; i --)
{
array[i] = array[i - 1];
}

array[0] = new_value;
Forum: Scripting Help 20/09/2018, 07:28 PM
Replies: 13
Views: 192
Posted By NaS
Re: mysql server stats

Actual Server Stats are still better to do with SUM or COUNT wherever you can. Especially kills/deaths/connects/num. of accounts.
Not only is it much easier than creating a seperate table and keep...
Forum: Scripting Help 20/09/2018, 03:17 PM
Replies: 13
Views: 192
Posted By NaS
Re: mysql server stats

You don't need to, the stats can be calculated from the users table any time. This also fixes any possible inconsitencies, like number of accounts when deleting one.
Forum: Scripting Help 20/09/2018, 03:12 PM
Replies: 13
Views: 192
Posted By NaS
Re: mysql server stats

You can use SUM to get the total number of (eg) kills:

SELECT SUM(`Kills`) AS `TotalKills` FROM `users`
Forum: Scripting Help 19/09/2018, 01:12 AM
Replies: 4
Views: 92
Posted By NaS
Re: Creating an offline admin ban

Create a new function (oBan or whatever) and add a string argument (player_name or so).
In that function simply execute the query jBan already uses, but instead of getting the name from a connected...
Forum: Scripting Help 18/09/2018, 01:41 AM
Replies: 3
Views: 72
Posted By NaS
Re: Doubt with textdraws

Unfortunately you cannot set other fonts than the default SAMP ones.

You can use custom fonts for SetObjectMaterialText, but that's just for objects.
Forum: Scripting Help 18/09/2018, 01:35 AM
Replies: 4
Views: 63
Posted By NaS
Re: Convert objects from MTA to SAMP? (Tried convertffs)

That is not possible in SA-MP. There's no breakable option for objects.
Forum: Scripting Help 17/09/2018, 05:51 PM
Replies: 5
Views: 120
Posted By NaS
Re: Bit operation

First off, 8 fails because you didn't set it.
Furthermore you use myVar1 twice and expect it to do different things (but in fact you set the 2nd twice).

Your test should be:


data |= myVar1;...
Forum: Scripting Help 17/09/2018, 03:01 AM
Replies: 20
Views: 367
Posted By NaS
Re: Mission label

You could insert a new line identifier automatically every X characters.


StringInsertNewLines(string[], charcount, insert[], size = sizeof string)
{
new len = strlen(string), lastspace = -1,...
Forum: Scripting Help 17/09/2018, 12:30 AM
Replies: 3
Views: 75
Posted By NaS
Re: offsets when attaching an object to a vehicle

Yea for an editor that shouldn't matter as you can control it.

I also have one that respects x, y and z rotation. That should be even better for TS, can PM it to you if you want.

The problem...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 10:32 PM.


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