SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 35
Search took 0.00 seconds.
Search: Posts Made By: algorhitmically
Forum: Includes 25/07/2020, 08:19 AM
Replies: 8
[Include] Model Sizes SQL
Views: 1,735
Posted By algorhitmically
Re: Model Sizes SQL

There is an updated version of m-sql include on github.
Make sure you try with new version, it should fix this issue.
Forum: Scripting Help 24/07/2020, 10:01 AM
Replies: 4
Views: 251
Posted By algorhitmically
Re: If vehicle damaged = less pay

case 5:
{
new vehicleid;
DisablePlayerCheckpoint(playerid);
if((vehicleid = GetPlayerVehicleID(playerid)))
{
new Float:health;
GetVehicleHealth(vehicleid,...
Forum: Scripting Help 24/07/2020, 12:03 AM
Replies: 4
Views: 185
Posted By algorhitmically
Re: Antiswear strreplace help

This code will loop through message replacing every single swear word with '*'.


#define MAX_SWEAR_WORDS 42

/*
- MAX_SWEAR_WORDS
= Max client message buffer(128) divided by minimal word...
Forum: Scripting Help 23/07/2020, 10:09 PM
Replies: 4
Views: 185
Posted By algorhitmically
Re: Antiswear strreplace help

strfind finds substring in a string.

You can try with this:


new swear[][] =
{
// ENGLISH
{"bitch"},
{"asshole"},
Forum: Scripting Help 23/07/2020, 09:42 PM
Replies: 4
Views: 251
Posted By algorhitmically
Re: If vehicle damaged = less pay

Well you can do this:

Get plane health and divide it by 1000.
This way you get vehicle health in percents.

Salary = (vehicle_health/1000) * (MaxSalary +- random value)
Forum: Includes 23/07/2020, 09:35 PM
Replies: 13
[Include] Optidraw
Views: 3,491
Posted By algorhitmically
Re: Optidraw

There are no dependency files located in your include directory.
Re-download the include and put optidraw_Data folder alongside with optidraw.inc in your server include directory.
Forum: Scripting Help 15/07/2020, 01:07 PM
Replies: 6
Views: 256
Posted By algorhitmically
Re: No nametag id only

#include <a_samp>

#define NAMETAG_DRAWDISTANCE (20)
#define NAMETAG_COLOR (0xFFFFFFFF)

new Text:pIDLabel[MAX_PLAYERS];

public OnGameModeInit()
{
ShowNameTags(0);
Forum: Scripting Help 14/07/2020, 07:23 PM
Replies: 15
Views: 728
Posted By algorhitmically
Re: Saving&Loading 100 Variables

Well, you can load and save with this method:


forward LoadZone(id, name[], value[]);
public LoadZone(id, name[], value[])
{
new Zone[8];
format(Zone, sizeof Zone, "Z_%d", id);...
Forum: Scripting Help 09/07/2020, 03:10 PM
Replies: 8
Views: 267
Posted By algorhitmically
Re: About difference

It should use less memory but I think it does not.
Assembly output is same for A[MAX] and A[MAX char]
Forum: Scripting Help 07/07/2020, 08:11 PM
Replies: 1
Views: 92
Posted By algorhitmically
Re: Tiled Material Text

Set larger font size and resolution or change object.
Forum: Scripting Help 07/07/2020, 08:08 PM
Replies: 3
Views: 175
Posted By algorhitmically
Re: It's possible use sscanf2 without zcmd ?

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/cmd", true))
{
// use sscanf if you need to catch parameters of command
return 1;
}
...
Forum: Scripting Help 04/07/2020, 08:16 PM
Replies: 14
Views: 559
Posted By algorhitmically
Re: How can I learn PAWN?

Learn basics: https://github.com/Y-Less/pawn-curriculum
alongside with wiki
Forum: Scripting Help 28/06/2020, 04:44 PM
Replies: 6
Views: 184
Posted By algorhitmically
Re: Skip song to another song [AudioStream]

Make the player variable now(example: new pSongID[MAX_PLAYERS]) and this should be used to track which song is played. You can make a list for songs in switch-case style and each case is one song so...
Forum: Scripting Help 28/06/2020, 07:24 AM
Replies: 3
Views: 117
Posted By algorhitmically
Re: Find player by name

stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}

stock GetPlayerIdFromName(const playername[]) {
foreach(new i :...
Forum: Scripting Help 28/06/2020, 12:04 AM
Replies: 6
Views: 184
Posted By algorhitmically
Re: Skip song to another song [AudioStream]

Just create an array and load some music info(name, streaming links).
Use OnPlayerClickTextdraw to handle clicks and for example:
if player clicks middle button: play song
else if player clicks...
Forum: Scripting Help 27/06/2020, 11:58 PM
Replies: 3
Views: 88
Posted By algorhitmically
Re: Prevent damage to teammates

OnPlayerTakeDamage:
Return Values:
1 - Callback will not be called in other filterscripts.
0 - Allows this callback to be called in other filterscripts.
It is always called first in filterscripts...
Forum: Includes 25/06/2020, 05:57 AM
Replies: 13
[Include] Optidraw
Views: 3,491
Posted By algorhitmically
Re: Optidraw

Use Streamer_UpdateEx/Streamer_Update function.
Forum: Scripting Help 20/04/2020, 09:46 PM
Replies: 3
Views: 126
Posted By algorhitmically
Re: OPTIMIZATION TIMERS!

That should not make lag, the game itself has more complex iterations than that. You can use tasks and optimize the checks etc.
Forum: Scripting Help 25/03/2020, 06:15 PM
Replies: 2
Views: 135
Posted By algorhitmically
Re: error 001: expected token: "{", but found "-integer value-"

new mission_name_id[4][4][4][256] =
{1, 0, "mission 1"},
{1, 0, "mission 2"},
{1, 1, "mission 3"},
{1, 1, "mission 4"};


you can use enum too:
Forum: Scripting Help 21/03/2020, 07:01 PM
Replies: 1
Views: 159
Posted By algorhitmically
Re: [REP++] Any good mysql approach on this problem?

You should try to normalize your database because your database is pretty big and it's good to save data in more tables so you can be more organized. Lag can happen if you send to many queries in...
Forum: Scripting Help 20/03/2020, 01:19 AM
Replies: 2
Views: 155
Posted By algorhitmically
Re: Help with single-dimensional array

stock arrContains(const array[], length, element)
{
for(new i; i < length; i++)
if(array[i] == element)
return true;
return false;
}


Then use it inside a command:
Forum: Scripting Help 17/03/2020, 10:12 PM
Replies: 7
Views: 147
Posted By algorhitmically
Re: Destroy Cars in an iter

There is predefined iterator in y_iterate: Vehicle.

foreach(new i : Vehicle) will loop through all spawned vehicles.
Forum: Scripting Help 07/03/2020, 10:44 PM
Replies: 8
Views: 412
Posted By algorhitmically
Re: how can i do this?

Example:

stock GetName(playerid)
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}

public OnPlayerText(playerid, text[])
Forum: Includes 07/03/2020, 09:51 AM
Replies: 13
[Include] Optidraw
Views: 3,491
Posted By algorhitmically
Re: Optidraw

Well, if you have problems with object loading or you don't have time to optimize maps you can use this include and the job will be done for you. You don't need to care about cars and other items...
Forum: Includes 04/03/2020, 11:34 PM
Replies: 8
[Include] Model Sizes SQL
Views: 1,735
Posted By algorhitmically
Re: Model Sizes SQL

You can find out: HERE (https://github.com/Crayder/Model-Sizes-Plus)

Basically, you can get model's collision spheres, offsets, bounding boxes and dimensions.
Showing results 1 to 25 of 35

 

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


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