Tis' possible?;)
#1

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

Yes it's possible.
Reply
#3

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
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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;
Reply
#8

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.
Reply
#9

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]);
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)