SA-MP Forums Archive
Tis' possible?;) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tis' possible?;) (/showthread.php?tid=336539)



Tis' possible?;) - BleverCastard - 22.04.2012

Using YSI, Is it possible to create a command that saves cars ingame and that will stay once the server has been restarted?


Re: Tis' possible?;) - Ubuntu - 22.04.2012

Yes it's possible.


Re: Tis' possible?;) - IceCube! - 22.04.2012

Thats way to long and dragged out to tell you how to here in code so imma give you a check list then ask for parts which your stuck on.

1. Create a enum inclding everything your cars require
2. create an array such as VehicleInfo[MAX_VEHICLES][vInfo]; to call the enum
3. sort out the saving and loading
4. Spawn a car
5. code a dialog or a command to save the car such as /savev - get the car the players in save it under a vehicle count ehich will be loaded next time the server starts
6. Use the command!
7. DOne


Re: Tis' possible?;) - Ubuntu - 22.04.2012

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Thats way to long and dragged out to tell you how to here in code so imma give you a check list then ask for parts which your stuck on.

1. Create a enum inclding everything your cars require
2. create an array such as VehicleInfo[MAX_VEHICLES][vInfo]; to call the enum
3. sort out the saving and loading
4. Spawn a car
5. code a dialog or a command to save the car such as /savev - get the car the players in save it under a vehicle count ehich will be loaded next time the server starts
6. Use the command!
7. DOne
All you need to do is to hire a professional scripter.


Re: Tis' possible?;) - ReneG - 22.04.2012

You don't need an enumerator for this. You don't even need y_ini. All you need to do is make a command to get all the vehicle info, and write it to a .cfg file, then OnGameModeInit(), loop through all the lines, and use sscanf to split up the line into parameters which are the vehicle info.


Re: Tis' possible?;) - BleverCastard - 22.04.2012

Thank you, Also one more thing..

Why is it, when a player registers I have PlayerInfo[playerid][pCash] += 2000; and it don't give them cash.


Re: Tis' possible?;) - Ubuntu - 22.04.2012

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
Thank you, Also one more thing..

Why is it, when a player registers I have PlayerInfo[playerid][pCash] ++ 2000; and it don't give them cash.
I highly suggest you to read https://sampwiki.blast.hk/wiki/Scripting_Basics.

PlayerInfo[playerid][pCash] += 2000;


Re: Tis' possible?;) - BleverCastard - 22.04.2012

Quote:
Originally Posted by Ubuntu
Посмотреть сообщение
I highly suggest you to read https://sampwiki.blast.hk/wiki/Scripting_Basics.

PlayerInfo[playerid][pCash] += 2000;
Sorry that's what I ment!

Edit: Still doesn't work.


Re: Tis' possible?;) - ReneG - 22.04.2012

Because, pInfo[playerid][pCash] is just a variable that belongs to a player. You have to give it physically like so.
pawn Код:
GivePlayerMoney(playerid, pInfo[playerid][pCash]);



Re: Tis' possible?;) - BleverCastard - 22.04.2012

Adding that under the register dialog will not give them money! since it doesn't know how much to give!