PDA

View Full Version : =>SInclude<= [v1.3] Usefull Functions


Sandra18[NL]
22/02/2008, 01:39 AM
I made, beside my Countdown-include, a Pocketmoney-include.
I decided to add them together to 1 include:

SInclude

This Includes:

Countdown
PocketMoney
CarFunctions
Skydiving
Saving & Loading player position
RandomSpawn-Creator


Update History:

[V1.0] (http://forum.sa-mp.com/index.php?topic=44484.msg324860#msg324860) <<<<========== Click for more explanation

CreateCountdown(time, sound);
CreatePlayerCountdown(playerid, time, sound);
StopCountdown();
StopPlayerCountdown(playerid);


[V1.1] (http://forum.sa-mp.com/index.php?topic=44484.msg324984#msg324984) <<<<========== Click for more explanation

EnablePocketMoney(amount, frequency);
DisablePocketMoney();
SetPocketMoneyAmount(amount);
SetPocketMoneyFrequency(seconds);
TogglePocketMoneyMessage(toggle);


[V1.2] (http://forum.sa-mp.com/index.php?topic=44484.msg325266#msg325266) <<<<========== Click for more explanation

SkydivePlayer(playerid, hight);
Cardive(carid, hight);
FlipCar(carid);
ResprayCar(carid);
SavePlayerPos(playerid);
LoadPlayerPos(playerid);


[V1.3] (http://forum.sa-mp.com/index.php?topic=44484.msg329020#msg329020) <<<<========== Click for more explanation

AddSpawnPos(X, Y, Z, Angle, Interior, VirtualWorld);
RandomSpawnPlayer(playerid);


[FS]SpawnPositionCreator (http://forum.sa-mp.com/index.php?topic=44484.msg329776#msg329776) <<<<========== Click for more explanation

With this filterscript you can easily create ready-to-use AddSpawnPos-functions
You can save a position using: /savespawnpos (+ comment (optional))
SavedSpawnPositions.txt
Interiors and VirtualWorlds are supported!


Notes:
- If a 'public' countdown is already started, you cant start a player-countdown
- If a player-countdown is running, and a public-countdown gets created, the player-countdown will stop.


Installing:
Put the file 'SInclude.inc' here:
Servermap/Pawno/Include

Then put on top of your gamemode:
#include <SInclude>


Download:
SpawnPositionCreator
- SpawnPositionSaver.pwn (Mediafire) (http://www.mediafire.com/?j9wv5mwa25s)
- SpawnPositionSaver.amx (Mediafire) (http://www.mediafire.com/?snv4irbx4om)

[V1.3]
- MediaFire (http://www.mediafire.com/?wdd2dzwx3xb)

[V1.2]
- MediaFire (http://www.mediafire.com/?gzi1idz45mc)
- PasteBin (http://pastebin.com/f5fcfd020)

[V1.1]
- MediaFire (http://www.mediafire.com/?8ztmopgd92f)
- Pastebin (http://pastebin.com/f6ac3ef2b)

[V1.0]
- MediaFire (http://www.mediafire.com/?5z4enb5mbiv)
- Pastebin (http://pastebin.com/f5f5e11eb)
- Crazyhost (http://www.crazyhost.info/download.php?file=770Countdown.inc) (Thanks Numhaken)
Note: If you're gonna use V1.0, the include is called: Countdown.inc
Mirrors are welcome :!:

Please Keep Credits!

If you find bugs, or do you have ideas or tips, please post them here.

Have fun with it! ;)

=>Sandra<=

Numhaken
22/02/2008, 02:16 AM
Nice!

Mirror
http://www.crazyhost.info/download.php?file=770Countdown.inc

Barret
22/02/2008, 02:21 AM
very very nice!
i like it :D
good job ;|

LarzI
22/02/2008, 02:28 AM
Love it! Was just looking for something like this! TYVM! I'll add you to the credits ;)

Abhishek
22/02/2008, 08:12 AM
cool!!! :D i was thinking to make something like this yesterday, now... no need :P tnx!

Sandra18[NL]
22/02/2008, 12:33 PM
[V1.0]

CreateCountdown(time, sound);
CreatePlayerCountdown(playerid, time, sound);
StopCountdown();
StopPlayerCountdown(playerid);


CreateCountdown = This will create a countdown for all players. If sound is enabled, you will hear beeps.
StopCountdown = This will stop the countdown if it is running.
CreatePlayerCountdown = This will create a countdown for only 1 player
StopPlayerCountdown = This will stop a player-countdown

snipe69
22/02/2008, 01:21 PM
nice script :D

P.S.: Are u girl or guy? coz sandra is girl name in my country :mrgreen:

Sandra18[NL]
22/02/2008, 01:25 PM
nice script :D

P.S.: Are u girl or guy? coz sandra is girl name in my country :mrgreen:

In my country too, so yes, im a girl.
But does it matter? :roll:

Antironix
22/02/2008, 01:56 PM
nice script :D

P.S.: Are u girl or guy? coz sandra is girl name in my country :mrgreen:

In my country too, so yes, im a girl.
But does it matter? :roll:


Most of us are nerds.. sooooooo xD ( not me)

eldiablo1337
22/02/2008, 02:04 PM
Nerds && Gicks (not me either :D )

Realy nice release, Sandra.. i like it :]
Would you like a mirror? direct one > through my FTP.

Sandra18[NL]
22/02/2008, 02:52 PM
New Version, new Name:

SInclude

5 new functions for PocketMoney!

EnablePocketMoney(amount, frequency);
DisablePocketMoney();
SetPocketMoneyAmount(amount);
SetPocketMoneyFrequency(seconds);
TogglePocketMoneyMessage(toggle);


EnablePocketMoney = All players will get some money after some time
DisablePocketMoney = To stop the server from giving players Pocketmoney
SetPocketMoneyAmount = To change the amount of money the players will get
SetPocketMoneyFrequency = To change the frequency
TogglePocketMoneyMessage = If '1', players will get a message. For Example:
You received $500,- Pocketmoney!
if Toggle = 0, players won't receive this message.

LarzI
22/02/2008, 03:07 PM
Like the update, nicely done ;)

Sandra18[NL]
22/02/2008, 10:56 PM
[V1.2]

SkydivePlayer(playerid, hight);
Cardive(carid, hight);
FlipCar(carid);
ResprayCar(carid);
SavePlayerPos(playerid);
LoadPlayerPos(playerid);


Skydive = Jumping with a parachute from a plane
Cardive = You will get droped with your vehicle
FlipCar = If your car is upsize down, you can flip it back on its wheels
Respray = You will get teleported to a Pay 'n Spray, and when respraying is done, you will get teleported back to your old position
SavePlayerPos = Store the position, angle and interior of a player
LoadPlayerPos = Player will get teleported to the position witch was saved with SavePlayerPos(playerid);

Maikel
22/02/2008, 11:05 PM
Nice, it's very simply for make good commands with this include. Good word :).

LarzI
23/02/2008, 12:04 AM
Tyvm ;) Really needed the respray function for my script Thanks a lot :D

Sandra18[NL]
26/02/2008, 08:12 PM
[V1.3]

AddSpawnPos(Float:X, Float:Y, Float:Z, Float:Angle, interior, virtualworld);
RandomSpawnPlayer(playerid);


AddSpawnPos = Add a position where a player can spawn to your gamemode.
You can put this function under OnGameModeInit, or you can use this function ingame.
Example:

if(strcmp(cmd, "/savepos", true) == 0)
{
new Float:X, Float:Y, Float:Z, Float:A, interior, vw;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
interior = GetPlayerInterior(playerid);
vw = GetPlayerVirtualWorld(playerid);
AddSpawnPos(X, Y, Z, A, interior, vw);
return 1;
}


Note: Positions you created ingame, won't get saved after server-restart!!!

RandomSpawnPlayer = This function will teleport a player to one of the postions created with AddSpawnPos.
You can put this function under OnPlayerSpawn

LarzI
27/02/2008, 01:39 PM
Love this include, nicely done ;)

cmg4life
27/02/2008, 03:07 PM
very nice Sandra :)

also could u make the a "RandomSpawnInArea(playerid, area max X, area max Y, area min X, area min Y);" ?

anyways its neat

Sandra18[NL]
27/02/2008, 05:02 PM
Thankss :D

I made a very small Filterscript to create SpawnPositions very easy.

With this filterscript you can easily create ready-to-use AddSpawnPos-functions
You can save a position using: /savespawnpos (+ comment (optional))
Positions will get saved in the file:
SavedSpawnPositions.txt

Interiors and VirtualWorlds are supported!

The download-urls are in the first post!!

Have fun

Zh3r0
01/04/2008, 11:29 AM
Damn Damn Damn thx Sandra :D ur the best ;) :lol:

Ignas1337
10/06/2008, 04:24 PM
go on, girl!

Sandra18[NL]
10/06/2008, 04:32 PM
Thank you all :)

Zh3r0
19/06/2008, 08:12 AM
You made my life, easy.

Prof_Oak
02/07/2008, 04:54 AM
bang-up, bully, corking, cracking, dandy, great, groovy, keen, neat, nifty, not bad, peachy, slap-up, swell, smashinggood enoughgoodishhotredeeming,satisfactory, acceptablesolidsuperbwell-behaved, well behaved


AWESOME!

Bogdan Cirstea
02/07/2008, 08:01 AM
woooow, girl, good joob :D

gta700
09/08/2008, 11:32 PM
im having a little trouble, i get this error:
C:\Users\cody mccoy\Desktop\Gta700 City\gamemodes\Xtreme.GM.pwn(47) : fatal error 100: cannot read from file: "Sinclude"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Killerkid
10/08/2008, 12:03 AM
im having a little trouble, i get this error:
C:\Users\cody mccoy\Desktop\Gta700 City\gamemodes\Xtreme.GM.pwn(47) : fatal error 100: cannot read from file: "Sinclude"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Put Sinclude inside includes folder, pawno/includes (if you're using pawno).

Nobbl
25/09/2008, 06:30 PM
Uhm, ive got a question. Ive never worked myself with includes and I want to add a countdowntimer, viewable for everyone.
What do i have to do? only
forward IsCountdownStarted;
forward IsPlayerCountdownStarted[MAX_PLAYERS];
forward PlayerCountdownCount[MAX_PLAYERS];
forward CountdownCount;
forward PlayerCountdownTimer[MAX_PLAYERS];
forward CountdownTimer;
and then, how do i have to add it?

Serbish
27/12/2008, 11:47 PM
Uhm, ive got a question. Ive never worked myself with includes and I want to add a countdowntimer, viewable for everyone.
What do i have to do? only
forward IsCountdownStarted;
forward IsPlayerCountdownStarted[MAX_PLAYERS];
forward PlayerCountdownCount[MAX_PLAYERS];
forward CountdownCount;
forward PlayerCountdownTimer[MAX_PLAYERS];
forward CountdownTimer;
and then, how do i have to add it?

The whole function of it.

Carl_Madson
09/02/2009, 08:43 AM
it doesn't work for me (v1.0) :-[

C:\Documents and Settings\Wooning\Bureaublad\games\games dingen\samp\server\gamemodes\Bonocity.pwn(21) : fatal error 100: cannot read from file: "Countdown"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

can u fix that? or tell me what to do?

AlExAlExAlEx
14/02/2009, 03:15 AM
nice very nice indeed
a update idea would be : random health&armor something like
SetRandomArmor(armor,randomnumber);
SetPlayerRandomArmor(playerid,randomid);

OnPlayerRandomArmor // just example
SetRandomArmor(10,random1);
SetRandomArmor(20,random1);
SetRandomArmor(30,random1);
SetPlayerRandomArmor(playerid,random1);

and would choose from 10 , 20 or 30.

a pic of you would be nice too :D