Bus card, simple script.
#1

Hello guys,

I new here on SAMP Forums, and I have an really simple question.
In my GM I want put an script to give to the player a card to ride the bus. He go to the government and type /buy bus card.

And then he could ride a bus, you can help me?

The bus system is an job, not NPC and I use an modificed version from Carlitos Roleplay.

PS: Sorry for my really bad english.
Reply
#2

Las_Venturas_CNR posted a response already, but I'm going to ask:
Do you want the bus card to SAVE, so that the player still has it after he left the server, or do you want the buscard to disappear when he leaves so he has to buy a new one ?
Reply
#3

Quote:
Originally Posted by Drebin
Посмотреть сообщение
Las_Venturas_CNR posted a response already, but I'm going to ask:
Do you want the bus card to SAVE, so that the player still has it after he left the server, or do you want the buscard to disappear when he leaves so he has to buy a new one ?
Thank you both!

Yes I like save (i think i will need dini rigth?), it's like unlimited. Like an drive license in Roleplay server's.
Reply
#4

Then you need to a variable in the userfile of a player (in your scriptfiles folder)
Eg. BusLicense = 0
When the player buys the bus card, change the value to 1
When he enters a bus, the server checks if the value behind BusLicense == 1, if it is he can enter, if it's not (when it's 0) he can't.
Reply
#5

Quote:
Originally Posted by Drebin
Посмотреть сообщение
Then you need to a variable in the userfile of a player (in your scriptfiles folder)
Eg. BusLicense = 0
When the player buys the bus card, change the value to 1
When he enters a bus, the server checks if the value behind BusLicense == 1, if it is he can enter, if it's not (when it's 0) he can't.
Hmm, well (maybe i too noob) but i can find anything in "Accounts" paste (I don't have lauch my server).
Reply
#6

You first have to create it. Look at what LAS_VENTURAS_CNR said before :P
Reply
#7

Quote:
Originally Posted by Drebin
Посмотреть сообщение
You first have to create it
Sorry (again), I have to create/open my server. Or the file? I'm really noob in english...
Reply
#8

Ok, if i'm correct is like that.

Код:
new HasBusCard[MAX_PLAYERS];

OnPlayerEnterVehicle > if(IsPassenger);
And then if the player don't have the card, he can't enter in the bus. Rigth?
Reply
#9

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER)
    {
             
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by Rafa
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER)
    {
             
    }
    return 1;
}
Thanks for help.
Like I said, I noob so I go ask you where I put this... Sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)