![]() |
Saving Info
(CHRIS: )
I need to know how to save varibles when my car runs out of gas and i need to make it so only ppl who OWN that car can fill it with more fuel to drive it away!!!!!!!!!! HELP !!! |
Post Answers plz!!!
I am only writing this to bring it back to the op of list because otherwise you get ignored!!!!!!!! PLZ DONT IGNORE ME I NEED HELP!!!!!!!!!!!
|
wasn't there something like this.strings for P2P Playerworlds?
so i would use something like this: if(buying){ sestring this.owner,#a; } filling: (use trigegraction for it) car: if(actionefillup){ if(strequals(this.owner,#a)){ this.gas=100; //just for example ;) } else {say2 Not Your car;} } the refiller if(weaponfired){ triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,fillup,#a; } don't know if it works... |
Thnx
Thnx i wil try it Ur good!
BTW: will that hang on even after they log off? |
i got a better wat to do it
i gfot a way to do it but i need to save it like position and stuff so they can come back to it!
|
Quote:
|
hers the script FILL ME UP DOC!
// NPC made by ~|¤Colit¤|~
if (playerenters) { message BUY ME!; this.fuel=100; this.x = x; this.y = y; } if (playertouchsme) { if (strequals(#c,Get in)){ set incar; setstring this.owner,#a; playerx = this.x; playery = this.y; hideplayer 1; } if (strequals(#c,Get in)){ if (this.owner == #a){ set incar; setstring this.owner,#a; playerx = this.x; playery = this.y; hideplayer 1; } }} if (strequals(#c,Exit)) { enableweapons; playerdir=2; playery+=2; unset incar; } while (playerhearts>=0) { if (incar) { if (keydown(0)) { if (!onwall(x+0.5,y-0.5)) { y-=0.5; this.fuel = this.fuel-.1; } } if (keydown(1)) { if (!onwall(x-0.5,y+0.5)) { x-=0.5; this.fuel = this.fuel-.1; } } if (keydown(2)) { if (!onwall(x+0.5,y+2)) { y+=0.5; this.fuel = this.fuel-.1; } } if (keydown(3)) { if (!onwall(x+2,y+0.5)) { x+=0.5; this.fuel = this.fuel-.1; } } }} while (playerhearts>=0) { if (incar) { if (keydown(0)) { if (!onwall(x+0.5,y-0.5)) { y-=0.5; this.fuel = this.fuel-.1; } this.cardir=0; } if (keydown(1)) { if (!onwall(x-0.5,y+0.5)) { x-=0.5; this.fuel = this.fuel-.1; } this.cardir=1; } if (keydown(2)) { if (!onwall(x+0.5,y+2)) { y+=0.5; this.fuel = this.fuel-.1; } this.cardir=2; } if (keydown(3)) { if (!onwall(x+2,y+0.5)) { x+=0.5; this.fuel = this.fuel-.1; } this.cardir=3; } if (exploded) { this.fuel--; } if (this.fuel<=0) { enableweapons; unset incar; } freezeplayer 0.05; hideplayer 0.05; playerx=x-0.5; playery=y-1; playerhearts=playerfullhearts; } message #v(this.fuel); sleep 0.05; } if (incar){ if (timeout){ message FUEL:#v(this.fuel); timeout = 1; }} now make it so i can fill the tank and save the location when the tank runs out even if they go offline plz help me! i need service stations too (cheaper ten the gas can and faster too!) |
good idea?
is this a good idea?
|
Re: hers the script FILL ME UP DOC!
first thing:
make a better keydown-routine with for loops for(this.i=0;this.i<4;this.i++){ if(keydown(this.i)){ if(!onwall(playerx+1.5+vecx(this.i)*.5,playery+2+v ecy(this.i)*.5)){ playerx+=vecx(this.i)*.5; playery+=vecy(this.i)*.5; playerdir=this.i; } } } it's not a good onwall check but I dont want to write too much ;) I would also use triggeractions for filling up but I think there is a better way then this I think of, if u use NPC-Server... |
No..........
Just tell me how i can increase a this. variable with another NPC i could put a value into a temp npc then say that (this.fuel=tempstr)
but i cant place a string ike that!!! HELOP?!?!?!?! |
PLZ hurry
PLZ hurry i only got 70 or 80 years left in my life!!!!!!!!!!!!!!!!!!!!!!!
<CHRIS> |
*blinks* Isn't this the sort of thing the save array is for?
|
(Nick: )Umm i think its like save[#] I used it before but didnt really understand it
|
Quote:
No, the save array is special, you have to put the index before the name of it, and it uses <>'s to mark the subscript instead of []'s [/sarcasm] ;) Just kidding, I was just wondering why you guys didn't use the save array instead of strings? |
SAVE ARRAY?
Well never used it before tell me how and i will use it! Otherwise im not up a crick w/out a paddle im in space without air!!!!
|
TELL ME NOW!
i am losing my patince tell me how to use the save array plz!?!?!?!
|
| All times are GMT +2. The time now is 01:39 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.