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 22/01/2020, 02:33 AM
Replies: 10
Views: 145
Posted By NaS
Re: Comparing names in an enum

strcmp returns 0 if the strings match, so you have to switch the enter garage and error message code (or change == 0 to != 0).
Forum: Scripting Help 18/01/2020, 05:24 PM
Replies: 14
Views: 341
Posted By NaS
Re: Make the world time the same for everyone

You can use SendRconCommand("worldtime 6:08"); to set the global time including minutes.
Forum: Scripting Help 17/01/2020, 06:53 PM
Replies: 14
Views: 341
Posted By NaS
Re: Make the world time the same for everyone

You can optimize the timer a lot by moving everything out of the for loop except SetPlayerTime. You are reformatting a string with the exact same text 1000 times in a row basically, and sending...
Forum: Scripting Help 23/12/2019, 01:38 PM
Replies: 2
Views: 91
Posted By NaS
Re: [CreatePlayer3DTextLabel] Not showing

It will only show 35 for each player. The limit for per-player labels is also per-player, that means you can create 1024 3D Text Labels for each player using CreatePlayer3DTextLabel. Only the global...
Forum: Scripting Help 22/12/2019, 06:11 AM
Replies: 2
Views: 107
Posted By NaS
Re: Problem selector

You used <= sizeof(...), however it should be < sizeof(...) because array indexes start at zero. For example an array of size 5 will have indexes from 0 to 4. Your code would loop from 0 to 5 which...
Forum: Filterscripts 18/12/2019, 07:01 PM
Replies: 215
Views: 56,918
Posted By NaS
Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Those might actually be related to the compiler version you are using. You can either look for the community compiler and use that one, or comment out the #pragma lines (they are only for compiling...
Forum: Scripting Help 10/12/2019, 06:12 PM
Replies: 6
Views: 171
Posted By NaS
Re: invalid function or declaration

If you want to start at 1 you'll need to increase the array size by 1 as well to pad it (not a big deal).

You could declare it like this (including initialization data):

new Worlds[][6] =
{...
Forum: Scripting Help 10/12/2019, 05:45 PM
Replies: 6
Views: 171
Posted By NaS
Re: invalid function or declaration

It might make sense to start from 0 instead of 1, since array indexes start at 0 (just as a sidenote).

What data exactly are you trying to store in the array though? Virtual World IDs?
Forum: Scripting Help 10/12/2019, 05:32 PM
Replies: 6
Views: 171
Posted By NaS
Re: invalid function or declaration

You need to assign all 3 dimensions a certain size when declaring an array when there is no initialization data, since PAWN doesn't know how large they shoud be if you don't.

For example:

new...
Forum: Scripting Help 09/12/2019, 06:13 PM
Replies: 5
Views: 98
Posted By NaS
Re: Help with vehicleid

for(new i=0; i<sizeof(KraftstoffCars); i++)
{
if(vID == KraftstoffCars[i][kID])
{
if(GetVehicleModel(GetVehicleTrailer(vID)) == 584)
{
tInfo[tID[playerid]][tFuelStand] = 100;...
Forum: Scripting Help 09/12/2019, 05:58 PM
Replies: 5
Views: 98
Posted By NaS
Re: Help with vehicleid

Instead of putting the second message (and return) into the loop, you must move it outside of the loop, otherwise it will execute at the first iteration where the player is not in the correct truck...
Forum: Scripting Help 07/12/2019, 02:15 PM
Replies: 4
Views: 126
Posted By NaS
Re: Question about function

Exactly, one of them will be executed before the other and once the first has finished completely, it will execute the other without any issues. Otherwise you would have huge problems with the amount...
Forum: Scripting Help 07/12/2019, 01:16 PM
Replies: 4
Views: 126
Posted By NaS
Re: Question about function

Pawn is running in a single thread (at least in SAMP), which means two functions can never run at the same time. It will only ever execute one instruction after the other.
Forum: Scripting Help 28/11/2019, 05:03 PM
Replies: 3
Views: 166
Posted By NaS
Re: SAFull.hmap + My Map

I would suggest looking into ColAndreas. It lets you add your custom maps to the collision world without building/creating a file everytime it changes, you can even change maps live on the server and...
Forum: Scripting Help 22/11/2019, 05:43 PM
Replies: 5
Views: 200
Posted By NaS
Re: HTTP and utf-8 encoding

You need to use Windows-1252 if you want the SAMP server to read it correctly. This also means switching the charset in the header AND editor, otherwise it will show incorrectly in browsers.
...
Forum: Scripting Help 19/11/2019, 04:21 PM
Replies: 1
Views: 155
Posted By NaS
Re: question about limits

No, the limit is independant from the amount of scripts. There are 100 Map Icon IDs for all scripts (per player).
If you use no streamer, the second script will most likely replace the MapIcons of...
Forum: Scripting Help 01/11/2019, 04:51 PM
Replies: 9
Views: 322
Posted By NaS
Re: Bike up arrow spam

That's not how the glitch works, KEY_UP and KEY_DOWN are the directional keys (W and S, used for acceleration and brakes). Those are not the buttons you do the glitch with, you need to check for...
Forum: Scripting Help 30/10/2019, 07:19 PM
Replies: 10
Views: 417
Posted By NaS
Re: FCNPC Crashing server.

Move all the FCNPC functions that come after FCNPC_Create to the callback FCNPC_OnCreate.

Make sure the npcid in that callback is actually the NPC you just created by checking if it is equal to...
Forum: Scripting Help 30/10/2019, 07:07 PM
Replies: 4
Views: 172
Posted By NaS
Re: Is it possible to zoom in on the textdraw sprite?

You need to use TextDrawTextSize to change the size (which op already did). Also that is not zooming, it's simply changing the total size. You cannot zoom in on sprites.

Depending on what you want...
Forum: Scripting Help 21/10/2019, 07:04 PM
Replies: 6
Views: 253
Posted By NaS
Re: mapandreas.

Because mapandreas returns the surface height but objects have their origins not neccessarily in the perfect spot, so you need to find a good Z offset for each model.
Actually on slopes etc you need...
Forum: Scripting Help 01/10/2019, 11:31 PM
Replies: 13
Views: 360
Posted By NaS
Re: Rounding a number

You're dividing an integer by another integer (I'm assuming pTokens is an integer). Divide it by 5.0 instead of 5 to do a floating point operation inside floatround, otherwise 27 / 5 will result in 5...
Forum: Scripting Help 19/09/2019, 05:45 PM
Replies: 2
Views: 137
Posted By NaS
Re: Making the "carry" animation stay while the player walks, jumps and whatnot.

You can apply the carry special action using SetPlayerSpecialAction:

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

(See at the very bottom, ID 25)

This will keep the animation while walking and...
Forum: Everything and Nothing 09/09/2019, 04:49 PM
Replies: 5
Views: 410
Posted By NaS
Re: Sublime Text 3

What encoding are you using? You can switch encoding in the lower right corner of Sublime, reopen the file with encoding Windows 1252 or UTF8 (make a backup first in case there are incompatible...
Forum: Scripting Help 09/09/2019, 04:46 PM
Replies: 1
Views: 97
Posted By NaS
Re: GetObjectPos Attach Vehicle

You need to recalculate the position relative to the vehicle. I'd suggest using Nero_3D's rotations.inc (link (https://forum.sa-mp.com/showthread.php?t=614857)).
...
Forum: Scripting Help 17/08/2019, 12:40 PM
Replies: 4
Views: 118
Posted By NaS
Re: Problem AUTO_INCREMENT

The ID is not an index like in an array, so just an artificial number and it doesn't really matter how big the number is.
This is also useful if you reference the ID somewhere else, if the character...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 01:44 AM.


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