Real Systems help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Real Systems help (
/showthread.php?tid=436036)
Real Systems help -
yaron0600 - 09.05.2013
I want to create so many systems of real like taking a shower , eat , drink , take a shit... , Piss
But what I need to know to create for it ? Give me example...
I need timer , the command and what to define etc help me...
Re: Real Systems help -
TheStreetsRP - 09.05.2013
I'm sorry, what are you trying to accomplish? Something like where a player types /shower and it says a message like "Joe_Dohn is taking a shower."?
Please explain more.
Re: Real Systems help -
Goldilox - 09.05.2013
So you want something like, on command /eat, the player applies an aciton of eating and so on?
Re: Real Systems help -
RenSoprano - 09.05.2013
You can make Hunger System
https://sampforum.blast.hk/showthread.php?tid=325755
Re: Real Systems help -
yaron0600 - 09.05.2013
Yeah all the things you just told , what I need for that ? I want same guide cause thats sound same everything but objects deffrent...
Re: Real Systems help -
Jay_Dixon - 09.05.2013
Well here's a simple shower CMD, build off that
Код:
CMD:shower(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 261.58, 71.01, 1003.24))
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You feel better after showering!");
new string[40];
format(string, sizeof(string), "* %s takes a shower.", PlayerNameEx(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, " You are not in a shower!");
}
return 1;
}
Hunger script that a friend of mine worked on last december
Код:
#include <a_samp>
#include <zcmd>
#define FILTERSCRIPT
//--------------------------[Configuration]------------------------------------|
#undef MAX_PLAYERS // |
#define MAX_PLAYERS 40 //Change this to your player slot amount |
#define N2E_TIME 10000 //Edit this value to change the timer, now = 10 mins |
#define LOOSING_HP 5 //The HP the player will lose |
//-----------------------------------------------------------------------------|
#define COLOR_RED 0xFF6347AA
//Forwards
forward NeedToEat(playerid);
//Arrays
new FirstSpawn[MAX_PLAYERS];
new Float:CurHealth[MAX_PLAYERS];
public OnFilterScriptInit()
{
}
public OnFilterScriptExit()
{
}
public OnPlayerSpawn(playerid)
{
FirstSpawn[playerid] += 1;
new Float:health;
GetPlayerHealth(playerid, health);
CurHealth[playerid] = health;
if(FirstSpawn[playerid] == 1)
SetTimerEx("NeedToEat",N2E_TIME,1,"i",playerid);
return 1;
}
public NeedToEat(playerid)
{
new Float:health;
GetPlayerHealth(playerid, health);
if(CurHealth[playerid] >= health)
{
SendClientMessage(playerid,COLOR_RED,"-| Your stomach starts to feel hungry, go eat something! |-");
SetPlayerHealth(playerid,health-LOOSING_HP);
CurHealth[playerid] = health;
}
else
{
CurHealth[playerid] = health;
}
}
CMD:eat(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 376.4745,-67.4357,1001.5078,358.0285))
{
SendClientMessage(playerid, COLOR_RED, "Thanks for visiting! Enjoy!");
GivePlayerMoney(playerid, -10);
SetTimerEx("NeedToEat",N2E_TIME,1,"i",playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not at a restaurant!");
}
return 1;
}