please help me with onplayerspawn
#1

how do i make my script from scratch so player spawn with the ammount of money 10000 because players spawn with 0
Reply
#2

Go into pawno and do file>new.
It will give you a basic layout for your script. (this is filterscript, if you want a gamemode then thats a little different).

make sure to change
//#define FILTERSCRIPT
to
#define FILTERSCRIPT

Then under OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, 10000);
	return 1;
}
It sounds like your new to pawno so you will need to:
http://forum.sa-mp.com/index.php?topic=2750.0
http://forum.sa-mp.com/index.php?topic=139.0
https://sampwiki.blast.hk/wiki/Main_Page
Reply
#3

i got it now so how do i make it save playermoney
Reply
#4

That gives them 10000 evry time they spawn.
If they only should spawn with 10000, put this:
pawn Код:
public OnPlayerSpawn(playerid)
{
  ResetPlayerMoney(playerid);
  GivePlayerMoney(playerid, 10000);
  return 1;
}
Reply
#5

To save things, you should use a File Engine or Databases.
Look at the one of the tutorials in the SAMP forum.
Reply
#6

can u give me a link
Reply
#7

http://forum.sa-mp.com/index.php?action=search
same way we all find tutorials.
Reply
#8

one more thing how do i add login system if i dont wanna use filterscript
Reply
#9

You mean you don't want to use someone elses filterscript?
Well you have to code one.

You would need to have player data that saves, dini etc
Then onplayerconnect show then a dialog or whatever and set a variable to login etc.

I would look at one that already exists to see how its done.
Reply
#10

Make your own its simple just go on wiki and follow instructions!

Are you a scripting begginer.
http://forum.sa-mp.com/index.php?topic=2750.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)