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: PowerPC603
Forum: Scripting Help 10/03/2017, 10:57 PM
Replies: 32
Views: 1,966
Posted By PowerPC603
Re: Auto Car Repair?

As you stated as well, it won't detect health changes like shooting the vehicle.
So other players can still shoot your vehicle until it explodes and that callback won't do a damn thing to repair...
Forum: Scripting Help 10/03/2017, 09:16 PM
Replies: 32
Views: 1,966
Posted By PowerPC603
Re: Auto Car Repair?

public AutoRepair()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!Autorepair[i]) continue;

if(IsPlayerInAnyVehicle(i))...
Forum: Scripting Help 09/03/2017, 09:32 PM
Replies: 10
Views: 1,194
Posted By PowerPC603
Re: MySQL lost connection?

Does the MySQL server run on the same machine as the SAMP server?
That would be recommended for fast access to your database.

Connecting to a remote MySQL server is usually not done.
It may...
Forum: Scripting Help 09/03/2017, 09:26 PM
Replies: 13
Views: 1,123
Posted By PowerPC603
Re: Player Password didn't read

You can already add my unfinished gamemode to that list :)
I have several queries which join 2 tables, but without the JOIN command inside it.
But the queries are loading data from 2 tables at the...
Forum: Scripting Help 09/03/2017, 10:15 AM
Replies: 13
Views: 1,123
Posted By PowerPC603
Re: Player Password didn't read

Recommending people to use DINI while learning to code is the same as recommending them to use GOTO everywhere, like they did in BASIC languages 30 years ago.

If you want to learn coding, do it...
Forum: Scripting Help 08/03/2017, 09:07 PM
Replies: 16
Views: 853
Posted By PowerPC603
Re: Help with Timer

DRIFT_HUNTER has already given the answer.
The function "gettime" returns a timestamp (see http://www.unixtimestamp.com/ for more info about it).
And this: http://wiki.sa-mp.com/wiki/Gettime.
...
Forum: Scripting Help 08/03/2017, 10:37 AM
Replies: 16
Views: 853
Posted By PowerPC603
Re: Help with Timer

The idea of DRIFT_HUNTER is the easiest to implement.
No need for timers, just one value that holds the timestamp when the last gift has been given.
When you're trying to get the gift again, simply...
Forum: Scripting Help 07/03/2017, 12:14 AM
Replies: 4
Views: 766
Posted By PowerPC603
Re: How to get player money from SQL?

If you just want to give a player some money, you don't need to know the money he has upfront.


UPDATE playerdata SET Money = Money + '%i' WHERE UserID = '%i'

Such a query gets the specified...
Forum: Scripting Help 03/03/2017, 03:27 PM
Replies: 10
Views: 701
Posted By PowerPC603
Re: ping TD

Use a timer with an interval of 1 second to update the ping textdraw, that should be enough.
Most online-games don't even display your ping all the time.
They display the ping when you use a /ping...
Forum: Scripting Help 27/02/2017, 07:06 PM
Replies: 10
Views: 1,194
Posted By PowerPC603
Re: MySQL lost connection?

%e is the same as %s (a string), but automatically escaped to prevent SQL injection.
Never use %s where you're loading/saving player-inputted text like a name or so.
Forum: Scripting Help 27/02/2017, 07:01 PM
Replies: 13
Views: 718
Posted By PowerPC603
Re: Speedcameras is not loading (R40)

My mistake, it should be:

cache_get_value_name_int(i, "Cam_ID", DID);
Forum: Scripting Help 26/02/2017, 07:58 PM
Replies: 13
Views: 718
Posted By PowerPC603
Re: Speedcameras is not loading (R40)

cache_get_value_name_float(i, "Cam_ID", DID);

You still need this to load the ID from the database.
Without it, DID will always have the value 0 and you will still store all data at index 0 of...
Forum: Scripting Help 26/02/2017, 09:00 AM
Replies: 13
Views: 718
Posted By PowerPC603
Re: Speedcameras is not loading (R40)

First of all:

DID = cache_get_value_name_int(i, "Cam_ID", gCameras[DID][Cam_ID]);


Taken from the wiki:


Using the return-value will make all your speedcams use index 1 of the array,...
Forum: Scripting Help 21/02/2017, 10:00 PM
Replies: 9
Views: 789
Posted By PowerPC603
Re: Vehicle tuning not saving[MySQL]

for(new i; i < 14; i++)
{
if(GetVehicleComponentType(componentid) == i)
{
AVehicleData[vehicleid][Components][i] = componentid;
}
}

Also, your for-loop wasn't...
Forum: Scripting Help 21/02/2017, 08:44 PM
Replies: 9
Views: 789
Posted By PowerPC603
Re: Vehicle tuning not saving[MySQL]

Directly taken from my new gamemode:

// This callback gets called whenever a player mods his vehicle
public OnVehicleMod(playerid, vehicleid, componentid)
{
// Setup local variables
new...
Forum: Scripting Help 19/02/2017, 09:44 PM
Replies: 4
Views: 517
Posted By PowerPC603
Re: [debug] Run time error 4: "Array index out of bounds"

Every house should have it's own ID stored in the database as well to be able to identify each house separately when you want to adjust data for a house later.

You can then use that ID as the...
Forum: Scripting Help 13/02/2017, 12:56 PM
Replies: 5
Views: 676
Posted By PowerPC603
Re: Checkpoint sizes do not "update"

Are all checkpoints resized for all players at once?
Or player per player?
If it's player per player (when they enter a checkpoint for example), it shouldn't matter.

I guess not all 500 players...
Forum: Scripting Help 12/02/2017, 08:51 PM
Replies: 1
Views: 517
Posted By PowerPC603
Re: Textdraw starts on new line after each space

Your textdraw goes from x = 361 (position of the top-left corner as defined in CreatePlayerTextDraw) to x = 385 (right-corner as defined in PlayerTextDrawTextSize), making it 24 pixels wide.
You...
Forum: Scripting Help 08/02/2017, 09:30 AM
Replies: 5
Views: 676
Posted By PowerPC603
Re: Checkpoint sizes do not "update"

You can try to set the new checkpoint via a timer.

I've experienced problems as well using a clickable textdraw menu by hiding all textdraws and the re-opening them in the same function.
The menu...
Forum: Scripting Help 07/02/2017, 10:11 PM
Replies: 11
Views: 1,262
Posted By PowerPC603
Re: Isn't this logic?

The problem is because loading rows from MySQL starts from row 0, while vehicleid's start from 1.
You're loading rows 0-2, while you're trying to get data from vehicleid 1-3.
That's why vehicleid...
Forum: Tutorials 29/01/2017, 08:20 PM
Replies: 41
Views: 57,004
Posted By PowerPC603
Re: MySQL [R41-2] Registration System

I don't see why you save a cache for later use.

When a player connects, just load his ID in the database that matches his name and load the hashed password and salt, store all 3 (password, salt...
Forum: Gamemode Scripts 09/04/2016, 10:41 PM
Replies: 6,020
[GameMode] PPC_Trucking V1
Views: 1,439,299
Posted By PowerPC603
Re: PPC_Trucking V1

It's also possible to allow the job-timer to let it scan for cargo constantly while the player hasn't accepted a job yet.

It runs all the time anyway and allows me to check for left-over cargo as...
Forum: Gamemode Scripts 08/04/2016, 09:09 PM
Replies: 6,020
[GameMode] PPC_Trucking V1
Views: 1,439,299
Posted By PowerPC603
Re: PPC_Trucking V1

They still need to be informed that there is some cargo on that vehicle/trailer anyways, otherwise they see it as a free trailer found somewhere and don't know what to do with it.

Each cargo-type...
Forum: Gamemode Scripts 07/04/2016, 12:56 PM
Replies: 6,020
[GameMode] PPC_Trucking V1
Views: 1,439,299
Posted By PowerPC603
Re: PPC_Trucking V1

Rewriting the job-system to function for almost any class seems to be harder than I thought.
Previously, I just used passengers as cargo and only the player's vehicle without a trailer.

The new...
Forum: Gamemode Scripts 01/04/2016, 09:32 AM
Replies: 6,020
[GameMode] PPC_Trucking V1
Views: 1,439,299
Posted By PowerPC603
Re: PPC_Trucking V1

When it's finished, it will be released.
And yes, V2 is fully MySQL.



I've modified cargo-types to have a variable price-profit-experience system.
Previously, to increase the payout for...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 06:14 AM.


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