SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 500
Search took 0.01 seconds.
Search: Posts Made By: FunnyBear
Forum: Scripting Help 22/01/2020, 07:23 PM
Replies: 10
Views: 310
Posted By FunnyBear
Forum: Scripting Help 22/01/2020, 06:00 PM
Replies: 10
Views: 310
Posted By FunnyBear
Re: Comparing names in an enum

I've already tried this. Thank you, though.
Forum: Scripting Help 22/01/2020, 05:02 PM
Replies: 10
Views: 310
Posted By FunnyBear
Re: Comparing names in an enum

Still does not work. Here's what I've got.

foreach(new i : Apartments)
{
if(strcmp(Name[playerid], aptInfo[i][apt_owner], true) != 0)
{
Error(playerid, "You do not own an apartment...
Forum: Scripting Help 22/01/2020, 12:31 PM
Replies: 10
Views: 310
Posted By FunnyBear
Re: Comparing names in an enum

If I do this, it puts me into someone else's apartment.
Forum: Scripting Help 21/01/2020, 10:31 PM
Replies: 10
Views: 310
Posted By FunnyBear
Question Comparing names in an enum

In short, I'm working on a garage feature for my apartment system. Currently the command is /entergarage and they must be in the checkpoint outside their garage inside a vehicle. The loop is to check...
Forum: Scripting Help 19/01/2020, 10:34 PM
Replies: 8
Views: 321
Posted By FunnyBear
Re: Macros

This is exactly what I already wrote?
Forum: Scripting Help 19/01/2020, 10:05 PM
Replies: 8
Views: 321
Posted By FunnyBear
Re: Macros

Aha, no. They have two different functions, I should have explained clearer. IncreaseWantedLevel is to increase it by a certain amount, SetWantedLevel is to set it to a certain amount.

If I use...
Forum: Scripting Help 19/01/2020, 09:08 PM
Replies: 8
Views: 321
Posted By FunnyBear
Macros

#define IncreaseWantedLevel(%1, %2) pWantedLevel[%1] += %2
#define SetWantedLevel(%1, %2) pWantedLevel[%1] = %2

Trying to use these, but keep on getting errors.
Forum: Scripting Help 17/01/2020, 04:19 PM
Replies: 14
Views: 502
Posted By FunnyBear
Re: Make the world time the same for everyone

Put this together quickly

new Text:td_time, Text:td_day, g_time = 0, g_day = 0;

#define MINUTE 1800
//define your minute in milliseconds (1.8 seconds in a game minute)

//OnGameModeInit
...
Forum: Scripting Help 17/01/2020, 12:38 AM
Replies: 0
Views: 88
Posted By FunnyBear
Profiler plugin

I decided to use the profiler plugin to view server performance and to see whether anything needs optimizing or not. I've run the plugin successfully and a file was outputted. I've had a look through...
Forum: Scripting Help 12/01/2020, 09:39 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Thank you, makes a lot of sense.



If I wanted to display the vehicle owner's name even if they had disconnected, is there a way instead of using Iter_Add(OwnedVehicles<playerid>, vehicleid) I...
Forum: Everything and Nothing 12/01/2020, 07:48 PM
Replies: 17
Views: 3,148
Posted By FunnyBear
Re: a crazy idea or not ...

Seems good on paper, but doubt many people would actually play.
Forum: Scripting Help 12/01/2020, 07:45 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

new vehicleid = GetPlayerVehicleID(playerid);
new ownerid = Iter_GetMulti(SpawnedVehicles<>, vehicleid),
player_name[MAX_PLAYER_NAME];

if(ownerid != INVALID_ITERATOR_SLOT &&...
Forum: Scripting Help 12/01/2020, 03:53 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Oh, right. I get you know. But what if I wanted to display the name of the owner of the vehicle?
Forum: Scripting Help 11/01/2020, 10:38 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

As I've said previously, I don't store the vehicleid in the Vehicles enum so I have nothing to compare the iter with
Forum: Scripting Help 11/01/2020, 07:27 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Iím not home right now but Iím guessing I could use

Iterator:SpawnedVehicles<MAX_VEHICLES, MAX_PLAYER_VEHICLES>;

Then when creating a vehicle just

Iter_Add(SpawnedVehicles<vehicles>,...
Forum: Scripting Help 11/01/2020, 02:19 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Can you expand?

Also, I just realised because Iím no longer storing vehicleid in the enum, I wonít have anything to crosscheck with from my SpawnedVehicles iter. So how would I check if a certain...
Forum: Scripting Help 11/01/2020, 01:36 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Yeah, I know. I was still yet to change it, wanted to check with you what to do first. Anyway, this is essentially what I've done so far. Am I on the right track?

new z, vehicleid;

for(z = 0; z...
Forum: Scripting Help 11/01/2020, 12:42 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Thank you, I think I understand now. But how would you add to array if not using a loop e.g. when purchasing a vehicle? For example:

public OnSavedVehicleCreated(id, model, playerid)
{...
Forum: Scripting Help 11/01/2020, 12:16 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

What do you mean by `z` is the iterator variable? Could you show me an example of how you would add vehicle data to the array using this 'iterator variable'?
Forum: Scripting Help 11/01/2020, 11:17 AM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

For various reasons actually, one being that my house system is interconnected with the vehicle system so players can own house vehicles. There's a couple other reasons aswell.

Could I just not...
Forum: Scripting Help 10/01/2020, 09:39 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Interesting, thanks for the help. However, I've got a question. When loading player vehicles (OnPlayerLoadVehicles), I do not intend to create the vehicle straight away, so how would I use Iter_Add...
Forum: Scripting Help 08/01/2020, 08:30 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Could you give me an example of how this would be used in the script that I used above? I've searched about iterators but not quite sure how I'd use it in this kind of vechicle system.
Forum: Scripting Help 08/01/2020, 03:52 PM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

This is how I'm loading my vehicles:

forward OnPlayerLoadVehicles(playerid);
public OnPlayerLoadVehicles(playerid)
{
new rows=cache_num_rows(), count = 0, id;
if(rows > 0)
{
for(new...
Forum: Scripting Help 08/01/2020, 09:20 AM
Replies: 32
Views: 867
Posted By FunnyBear
Re: Looping through enum

Doesn't quite seem to work either. Returns 1 even though I actually have 17 vehicles.



It's not for a roleplay server and I don't use underscores in my name.
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 07:05 AM.


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