Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
TakTak :P
Created
6 years ago
Diff never expires
Clear
Export
Share
Explain
179 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
224 lines
Copy
126 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
224 lines
Copy
#if !defined _samp_included
#if !defined _samp_included
Copy
Copied
Copy
Copied
#error
Please
include a_samp
before actor_robbery.
#error
Lütfen
include a_samp
önce includesini pawn dosyaniza ekleyiniz ondan sonra Soygun_Aktor includesini ekleyiniz. // #include <a_samp> olmazsa bu hatayý verir.
#endif
#endif
#if !defined KEY_AIM
#if !defined KEY_AIM
Copy
Copied
Copy
Copied
#define KEY_AIM 128
#define KEY_AIM 128
#endif
#endif
#if !defined PreloadAnimLib
#if !defined PreloadAnimLib
Copy
Copied
Copy
Copied
#define PreloadAnimLib(%1,%2) ApplyAnimation(%1,%2,"null",0.0,0,0,0,0,0)
#define PreloadAnimLib(%1,%2) ApplyAnimation(%1,%2,"null",0.0,0,0,0,0,0)
#endif
#endif
Copy
Copied
Copy
Copied
#define MAX_
ROBBERY_AC
TOR
S
(50)
#define MAX_
SOYGUN_AK
TOR
(50)
Copy
Copied
Copy
Copied
#define
TYPE_SUCCESS
(0)
#define
BASARILI_SOYGUN
(0)
#define
TYPE_FAILED
(1)
#define
BASARISIZ_SOYGUN
(1)
#define
TYPE_UNFINISHED
(2)
#define
SOYGUN_BITIRILMEDI
(2)
Copy
Copied
Copy
Copied
#define MIN_
MONEY_ROB
500
#define MIN_
PARA
1000
#define MAX_
MONEY_ROB
1
0000
#define MAX_
PARA
2
0000
#define
ROBBERY_WAIT_TIME
(5)
#define
SOYGUN_GERI_SAYIM
(5)
Copy
Copied
Copy
Copied
enum
E_AC
TOR_
ROBBERY_DATA
enum
AK
TOR_
SOYGUN
{
{
Copy
Copied
Copy
Copied
actor_skin,
actor_skin,
Float:actor_x,
Float:actor_x,
Float:actor_y,
Float:actor_y,
Float:actor_z,
Float:actor_z,
Float:actor_ang,
Float:actor_ang,
actor_vw,
actor_vw,
money_min,
money_min,
money_max,
money_max,
Copy
Copied
Copy
Copied
bool:actor_created,
bool:actor_created,
actor_robbedRecently
actor_robbedRecently
}
}
Copy
Copied
Copy
Copied
static
static
robbery
_data[MAX_
ROBBERY_AC
TOR
S][E_AC
TOR_
ROBBERY_DATA
],
soygun
_data[MAX_
SOYGUN_AK
TOR
][AK
TOR_
SOYGUN
],
i_actor = 0;
i_actor = 0;
Copy
Copied
Copy
Copied
forward
RunActorAnimationSequence
(playerid, actorid, animation_pattern);
forward
AktorAnimasyon
(playerid, actorid, animation_pattern);
forward
OnPlayerStartRobbery
(playerid, actorid, robbed_recently);
forward
SoygunBaslangic
(playerid, actorid, robbed_recently);
forward
OnPlayerFinishRobbery
(playerid, actorid, robbedmoney, type);
forward
SoygunBitis
(playerid, actorid, robbedmoney, type);
Copy
Copied
Copy
Copied
stock
CreateActorRobbery
(skinid, Float:x, Float:y, Float:z, Float:ang, actor_vwid = 0, r_moneymin = MIN_
MONEY_ROB
, r_moneymax = MAX_
MONEY_ROB
)
stock
AktorOlustur
(skinid, Float:x, Float:y, Float:z, Float:ang, actor_vwid = 0, r_moneymin = MIN_
PARA
, r_moneymax = MAX_
PARA
)
{
{
Copy
Copied
Copy
Copied
new actorid =
GetActorFreeID
();
new actorid =
SoygunAktorID
();
Copy
Copied
Copy
Copied
if(actorid == -1)
if(actorid == -1)
{
{
print("ERROR: MAX_
ROBBERY_AC
TOR reached, increase the limit size.");
print("ERROR: MAX_
SOYGUN_AK
TOR reached, increase the limit size.");
return -1;
return -1;
}
}
Copy
Copied
Copy
Copied
CreateActor(skinid, x, y, z, ang);
CreateActor(skinid, x, y, z, ang);
SetActorVirtualWorld(actorid, actor_vwid);
SetActorVirtualWorld(actorid, actor_vwid);
Copy
Copied
Copy
Copied
robbery
_data[actorid][actor_created] = true;
soygun
_data[actorid][actor_created] = true;
robbery
_data[actorid][actor_skin] = skinid;
soygun
_data[actorid][actor_skin] = skinid;
robbery
_data[actorid][actor_x] = x;
soygun
_data[actorid][actor_x] = x;
robbery
_data[actorid][actor_y] = y;
soygun
_data[actorid][actor_y] = y;
robbery
_data[actorid][actor_z] = z;
soygun
_data[actorid][actor_z] = z;
robbery
_data[actorid][actor_ang] = ang;
soygun
_data[actorid][actor_ang] = ang;
robbery
_data[actorid][actor_vw] = actor_vwid;
soygun
_data[actorid][actor_vw] = actor_vwid;
robbery
_data[actorid][money_min] = r_moneymin;
soygun
_data[actorid][money_min] = r_moneymin;
robbery
_data[actorid][money_max] = r_moneymax;
soygun
_data[actorid][money_max] = r_moneymax;
Copy
Copied
Copy
Copied
return (++ i_actor - 1);
return (++ i_actor - 1);
}
}
Copy
Copied
Copy
Copied
stock
GetActorRobberyData
(actorid, &skinid, &Float:x, &Float:y, &Float:z, &Float:ang, &actor_vwid, &r_moneymin, &r_moneymax)
stock
AktorSoygunVeri
(actorid, &skinid, &Float:x, &Float:y, &Float:z, &Float:ang, &actor_vwid, &r_moneymin, &r_moneymax)
{
{
Copy
Copied
Copy
Copied
if(actorid == INVALID_ACTOR_ID)
if(actorid == INVALID_ACTOR_ID)
return 1;
return 1;
Copy
Copied
Copy
Copied
skinid =
robbery
_data[actorid][actor_skin];
skinid =
soygun
_data[actorid][actor_skin];
x =
robbery
_data[actorid][actor_x];
x =
soygun
_data[actorid][actor_x];
y =
robbery
_data[actorid][actor_y];
y =
soygun
_data[actorid][actor_y];
z =
robbery
_data[actorid][actor_z] ;
z =
soygun
_data[actorid][actor_z] ;
ang =
robbery
_data[actorid][actor_ang] ;
ang =
soygun
_data[actorid][actor_ang] ;
actor_vwid =
robbery
_data[actorid][actor_vw];
actor_vwid =
soygun
_data[actorid][actor_vw];
r_moneymin =
robbery
_data[actorid][money_min];
r_moneymin =
soygun
_data[actorid][money_min];
r_moneymax =
robbery
_data[actorid][money_max];
r_moneymax =
soygun
_data[actorid][money_max];
return 1;
return 1;
}
}
Copy
Copied
Copy
Copied
static
GetActorFreeID()
static
SoygunAktorID()
{
{
Copy
Copied
Copy
Copied
for(new i = 0; i < MAX_
ROBBERY_AC
TOR
S
; i++)
for(new i = 0; i < MAX_
SOYGUN_AK
TOR
; i++)
{
{
if(!
robbery
_data[i][actor_created]) return i;
if(!
soygun
_data[i][actor_created]) return i;
}
}
return -1;
return -1;
// buraya kesinlikle ellemeyin textdrawli yapacaksaniz "-1" ama textdrawsiz ise "+1" seklinde yapiniz.
}
}
Copy
Copied
Copy
Copied
public
RunActorAnimationSequence
(playerid, actorid, animation_pattern)
public
AktorAnimasyon
(playerid, actorid, animation_pattern)
{
{
Copy
Copied
Copy
Copied
switch(animation_pattern)
switch(animation_pattern)
{
{
case 0:
case 0:
{
{
ClearActorAnimations(actorid);
ClearActorAnimations(actorid);
ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 0, 1, 1, 1, 0);
ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 0, 1, 1, 1, 0);
SetTimerEx("RunActorAnimationSequence", 1000 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 1);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(!IsPlayerConnected(i)) { continue; }
PlayerPlaySound(i, 3401, x, y, z);
}
}
case 1:
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, robbery_data[actorid][actor_x], robbery_data[actorid][actor_y], robbery_data[actorid][actor_z]))
{
OnPlayerFinishRobbery(playerid, actorid, 0, TYPE_UNFINISHED);
}
else
{
ClearActorAnimations(actorid);
ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_GiveCash", 4.1, 0, 1, 1, 1, 0);
SetTimerEx("RunActorAnimationSequence", 1000 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 2);
}
}
case 2:
{
ClearActorAnimations(actorid);
ApplyActorAnimation(actorid, "PED", "DUCK_cower", 4.1, 1, 1, 1, 1, 1);
SetTimerEx("RunActorAnimationSequence", 1000 * 60 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 3);
new
robberyChance = random(100);
if(robberyChance > 40)
{
OnPlayerFinishRobbery(playerid, actorid, (random(robbery_data[actorid][money_max] - robbery_data[actorid][money_min]) + robbery_data[actorid][money_min]), TYPE_SUCCESS);
}
else OnPlayerFinishRobbery(playerid, actorid, 0, TYPE_FAILED);
}
case 3:
{
ClearActorAnimations(actorid);
PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0);
}
Copy
Copied
Copy
Copied
}
SetTimerEx("AktorAnimasyon", 1000 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 1);
return 1;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(!IsPlayerConnected(i)) { continue; }
PlayerPlaySound(i, 3401, x, y, z);
}
}
case 1:
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, soygun_data[actorid][actor_x], soygun_data[actorid][actor_y], soygun_data[actorid][actor_z]))
{
SoygunBitis(playerid, actorid, 0, SOYGUN_BITIRILMEDI);
}
else
{
ClearActorAnimations(actorid);
ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_GiveCash", 4.1, 0, 1, 1, 1, 0);
SetTimerEx("AktorAnimasyon", 1000 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 2);
}
}
case 2:
{
ClearActorAnimations(actorid);
ApplyActorAnimation(actorid, "PED", "DUCK_cower", 4.1, 1, 1, 1, 1, 1);
SetTimerEx("AktorAnimasyon", 1000 * 60 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 3);
new
robberyChance = random(100);
if(robberyChance > 40)
{
SoygunBitis(playerid, actorid, (random(soygun_data[actorid][money_max] - soygun_data[actorid][money_min]) + soygun_data[actorid][money_min]), BASARILI_SOYGUN);
}
else SoygunBitis(playerid, actorid, 0, BASARISIZ_SOYGUN);
}
case 3:
{
ClearActorAnimations(actorid);
PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0);
}
}
return 1;
}
}
public OnPlayerConnect(playerid)
public OnPlayerConnect(playerid)
{
{
Copy
Copied
Copy
Copied
EnablePlayerCameraTarget(playerid, 1);
EnablePlayerCameraTarget(playerid, 1);
Copy
Copied
Copy
Copied
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "SHOP");
PreloadAnimLib(playerid, "SHOP");
Copy
Copied
Copy
Copied
#if defined actorrob_OnPlayerConnect
#if defined actorrob_OnPlayerConnect
actorrob_OnPlayerConnect(playerid);
actorrob_OnPlayerConnect(playerid);
#endif
#endif
return 1;
return 1;
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
{
Copy
Copied
Copy
Copied
if((newkeys & KEY_AIM) == KEY_AIM && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
if((newkeys & KEY_AIM) == KEY_AIM && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
{
switch(GetPlayerWeapon(playerid))
switch(GetPlayerWeapon(playerid))
{
{
case 22 .. 33:
case 22 .. 33:
{
{
new actorid = GetPlayerCameraTargetActor(playerid);
new actorid = GetPlayerCameraTargetActor(playerid);
Copy
Copied
Copy
Copied
if(actorid == INVALID_ACTOR_ID)
if(actorid == INVALID_ACTOR_ID)
return 1;
return 1;
Copy
Copied
Copy
Copied
if(gettime() -
robbery
_data[actorid][actor_robbedRecently] < 60 *
ROBBERY_WAIT_TIME)
if(gettime() -
soygun
_data[actorid][actor_robbedRecently] < 60 *
SOYGUN_GERI_SAYIM)
return
OnPlayerStartRobbery
(playerid, actorid, 1);
return
SoygunBaslangic
(playerid, actorid, 1);
Copy
Copied
Copy
Copied
robbery
_data[actorid][actor_robbedRecently] = gettime();
soygun
_data[actorid][actor_robbedRecently] = gettime();
RunActorAnimationSequence
(playerid, actorid, 0);
AktorAnimasyon
(playerid, actorid, 0);
}
}
}
}
}
}
#if defined actorrob_OnPlayerKeyStateChange
#if defined actorrob_OnPlayerKeyStateChange
actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
#else
#else
return 1;
return 1;
#endif
#endif
}
}
Copy
Copied
Copy
Copied
//OnPlayerKeyStateChange hook
directives
//OnPlayerKeyStateChange hook
şeklinde yapınız.
#if defined _ALS_OnPlayerKeyStateChange
#if defined _ALS_OnPlayerKeyStateChange
#undef OnPlayerKeyStateChange
#undef OnPlayerKeyStateChange
#else
#else
#define _ALS_OnPlayerKeyState
#define _ALS_OnPlayerKeyState
#endif
#endif
#define OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange
#define OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange
#if defined actorrob_OnPlayerKeyStateChange
#if defined actorrob_OnPlayerKeyStateChange
forward actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
forward actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
#endif
#endif
Copy
Copied
Copy
Copied
//OnPlayerConnect
directives
//OnPlayerConnect
Bölümü
#if defined _ALS_OnPlayerConnect
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#undef OnPlayerConnect
#else
#else
#define _ALS_OnPlayerConnect
#define _ALS_OnPlayerConnect
#endif
#endif
#define OnPlayerConnect actorrob_OnPlayerConnect
#define OnPlayerConnect actorrob_OnPlayerConnect
#if defined actorrob_OnPlayerConnect
#if defined actorrob_OnPlayerConnect
forward actorrob_OnPlayerConnect(playerid);
forward actorrob_OnPlayerConnect(playerid);
#endif
#endif
Saved diffs
Original text
Open file
#if !defined _samp_included #error Please include a_samp before actor_robbery. #endif #if !defined KEY_AIM #define KEY_AIM 128 #endif #if !defined PreloadAnimLib #define PreloadAnimLib(%1,%2) ApplyAnimation(%1,%2,"null",0.0,0,0,0,0,0) #endif #define MAX_ROBBERY_ACTORS (50) #define TYPE_SUCCESS (0) #define TYPE_FAILED (1) #define TYPE_UNFINISHED (2) #define MIN_MONEY_ROB 500 #define MAX_MONEY_ROB 10000 #define ROBBERY_WAIT_TIME (5) enum E_ACTOR_ROBBERY_DATA { actor_skin, Float:actor_x, Float:actor_y, Float:actor_z, Float:actor_ang, actor_vw, money_min, money_max, bool:actor_created, actor_robbedRecently } static robbery_data[MAX_ROBBERY_ACTORS][E_ACTOR_ROBBERY_DATA], i_actor = 0; forward RunActorAnimationSequence(playerid, actorid, animation_pattern); forward OnPlayerStartRobbery(playerid, actorid, robbed_recently); forward OnPlayerFinishRobbery(playerid, actorid, robbedmoney, type); stock CreateActorRobbery(skinid, Float:x, Float:y, Float:z, Float:ang, actor_vwid = 0, r_moneymin = MIN_MONEY_ROB, r_moneymax = MAX_MONEY_ROB) { new actorid = GetActorFreeID(); if(actorid == -1) { print("ERROR: MAX_ROBBERY_ACTOR reached, increase the limit size."); return -1; } CreateActor(skinid, x, y, z, ang); SetActorVirtualWorld(actorid, actor_vwid); robbery_data[actorid][actor_created] = true; robbery_data[actorid][actor_skin] = skinid; robbery_data[actorid][actor_x] = x; robbery_data[actorid][actor_y] = y; robbery_data[actorid][actor_z] = z; robbery_data[actorid][actor_ang] = ang; robbery_data[actorid][actor_vw] = actor_vwid; robbery_data[actorid][money_min] = r_moneymin; robbery_data[actorid][money_max] = r_moneymax; return (++ i_actor - 1); } stock GetActorRobberyData(actorid, &skinid, &Float:x, &Float:y, &Float:z, &Float:ang, &actor_vwid, &r_moneymin, &r_moneymax) { if(actorid == INVALID_ACTOR_ID) return 1; skinid = robbery_data[actorid][actor_skin]; x = robbery_data[actorid][actor_x]; y = robbery_data[actorid][actor_y]; z = robbery_data[actorid][actor_z] ; ang = robbery_data[actorid][actor_ang] ; actor_vwid = robbery_data[actorid][actor_vw]; r_moneymin = robbery_data[actorid][money_min]; r_moneymax = robbery_data[actorid][money_max]; return 1; } static GetActorFreeID() { for(new i = 0; i < MAX_ROBBERY_ACTORS; i++) { if(!robbery_data[i][actor_created]) return i; } return -1; } public RunActorAnimationSequence(playerid, actorid, animation_pattern) { switch(animation_pattern) { case 0: { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 0, 1, 1, 1, 0); SetTimerEx("RunActorAnimationSequence", 1000 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 1); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(!IsPlayerConnected(i)) { continue; } PlayerPlaySound(i, 3401, x, y, z); } } case 1: { if(!IsPlayerInRangeOfPoint(playerid, 10.0, robbery_data[actorid][actor_x], robbery_data[actorid][actor_y], robbery_data[actorid][actor_z])) { OnPlayerFinishRobbery(playerid, actorid, 0, TYPE_UNFINISHED); } else { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_GiveCash", 4.1, 0, 1, 1, 1, 0); SetTimerEx("RunActorAnimationSequence", 1000 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 2); } } case 2: { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "PED", "DUCK_cower", 4.1, 1, 1, 1, 1, 1); SetTimerEx("RunActorAnimationSequence", 1000 * 60 * ROBBERY_WAIT_TIME, false, "iii", playerid, actorid, 3); new robberyChance = random(100); if(robberyChance > 40) { OnPlayerFinishRobbery(playerid, actorid, (random(robbery_data[actorid][money_max] - robbery_data[actorid][money_min]) + robbery_data[actorid][money_min]), TYPE_SUCCESS); } else OnPlayerFinishRobbery(playerid, actorid, 0, TYPE_FAILED); } case 3: { ClearActorAnimations(actorid); PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0); } } return 1; } public OnPlayerConnect(playerid) { EnablePlayerCameraTarget(playerid, 1); PreloadAnimLib(playerid, "PED"); PreloadAnimLib(playerid, "SHOP"); #if defined actorrob_OnPlayerConnect actorrob_OnPlayerConnect(playerid); #endif return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((newkeys & KEY_AIM) == KEY_AIM && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { switch(GetPlayerWeapon(playerid)) { case 22 .. 33: { new actorid = GetPlayerCameraTargetActor(playerid); if(actorid == INVALID_ACTOR_ID) return 1; if(gettime() - robbery_data[actorid][actor_robbedRecently] < 60 * ROBBERY_WAIT_TIME) return OnPlayerStartRobbery(playerid, actorid, 1); robbery_data[actorid][actor_robbedRecently] = gettime(); RunActorAnimationSequence(playerid, actorid, 0); } } } #if defined actorrob_OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) #else return 1; #endif } //OnPlayerKeyStateChange hook directives #if defined _ALS_OnPlayerKeyStateChange #undef OnPlayerKeyStateChange #else #define _ALS_OnPlayerKeyState #endif #define OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange #if defined actorrob_OnPlayerKeyStateChange forward actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) #endif //OnPlayerConnect directives #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect actorrob_OnPlayerConnect #if defined actorrob_OnPlayerConnect forward actorrob_OnPlayerConnect(playerid); #endif
Changed text
Open file
#if !defined _samp_included #error Lütfen include a_samp önce includesini pawn dosyaniza ekleyiniz ondan sonra Soygun_Aktor includesini ekleyiniz. // #include <a_samp> olmazsa bu hatayý verir. #endif #if !defined KEY_AIM #define KEY_AIM 128 #endif #if !defined PreloadAnimLib #define PreloadAnimLib(%1,%2) ApplyAnimation(%1,%2,"null",0.0,0,0,0,0,0) #endif #define MAX_SOYGUN_AKTOR (50) #define BASARILI_SOYGUN (0) #define BASARISIZ_SOYGUN (1) #define SOYGUN_BITIRILMEDI (2) #define MIN_PARA 1000 #define MAX_PARA 20000 #define SOYGUN_GERI_SAYIM (5) enum AKTOR_SOYGUN { actor_skin, Float:actor_x, Float:actor_y, Float:actor_z, Float:actor_ang, actor_vw, money_min, money_max, bool:actor_created, actor_robbedRecently } static soygun_data[MAX_SOYGUN_AKTOR][AKTOR_SOYGUN], i_actor = 0; forward AktorAnimasyon(playerid, actorid, animation_pattern); forward SoygunBaslangic(playerid, actorid, robbed_recently); forward SoygunBitis(playerid, actorid, robbedmoney, type); stock AktorOlustur(skinid, Float:x, Float:y, Float:z, Float:ang, actor_vwid = 0, r_moneymin = MIN_PARA, r_moneymax = MAX_PARA) { new actorid = SoygunAktorID(); if(actorid == -1) { print("ERROR: MAX_SOYGUN_AKTOR reached, increase the limit size."); return -1; } CreateActor(skinid, x, y, z, ang); SetActorVirtualWorld(actorid, actor_vwid); soygun_data[actorid][actor_created] = true; soygun_data[actorid][actor_skin] = skinid; soygun_data[actorid][actor_x] = x; soygun_data[actorid][actor_y] = y; soygun_data[actorid][actor_z] = z; soygun_data[actorid][actor_ang] = ang; soygun_data[actorid][actor_vw] = actor_vwid; soygun_data[actorid][money_min] = r_moneymin; soygun_data[actorid][money_max] = r_moneymax; return (++ i_actor - 1); } stock AktorSoygunVeri(actorid, &skinid, &Float:x, &Float:y, &Float:z, &Float:ang, &actor_vwid, &r_moneymin, &r_moneymax) { if(actorid == INVALID_ACTOR_ID) return 1; skinid = soygun_data[actorid][actor_skin]; x = soygun_data[actorid][actor_x]; y = soygun_data[actorid][actor_y]; z = soygun_data[actorid][actor_z] ; ang = soygun_data[actorid][actor_ang] ; actor_vwid = soygun_data[actorid][actor_vw]; r_moneymin = soygun_data[actorid][money_min]; r_moneymax = soygun_data[actorid][money_max]; return 1; } static SoygunAktorID() { for(new i = 0; i < MAX_SOYGUN_AKTOR; i++) { if(!soygun_data[i][actor_created]) return i; } return -1; // buraya kesinlikle ellemeyin textdrawli yapacaksaniz "-1" ama textdrawsiz ise "+1" seklinde yapiniz. } public AktorAnimasyon(playerid, actorid, animation_pattern) { switch(animation_pattern) { case 0: { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 0, 1, 1, 1, 0); SetTimerEx("AktorAnimasyon", 1000 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 1); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(!IsPlayerConnected(i)) { continue; } PlayerPlaySound(i, 3401, x, y, z); } } case 1: { if(!IsPlayerInRangeOfPoint(playerid, 10.0, soygun_data[actorid][actor_x], soygun_data[actorid][actor_y], soygun_data[actorid][actor_z])) { SoygunBitis(playerid, actorid, 0, SOYGUN_BITIRILMEDI); } else { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_GiveCash", 4.1, 0, 1, 1, 1, 0); SetTimerEx("AktorAnimasyon", 1000 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 2); } } case 2: { ClearActorAnimations(actorid); ApplyActorAnimation(actorid, "PED", "DUCK_cower", 4.1, 1, 1, 1, 1, 1); SetTimerEx("AktorAnimasyon", 1000 * 60 * SOYGUN_GERI_SAYIM, false, "iii", playerid, actorid, 3); new robberyChance = random(100); if(robberyChance > 40) { SoygunBitis(playerid, actorid, (random(soygun_data[actorid][money_max] - soygun_data[actorid][money_min]) + soygun_data[actorid][money_min]), BASARILI_SOYGUN); } else SoygunBitis(playerid, actorid, 0, BASARISIZ_SOYGUN); } case 3: { ClearActorAnimations(actorid); PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0); } } return 1; } public OnPlayerConnect(playerid) { EnablePlayerCameraTarget(playerid, 1); PreloadAnimLib(playerid, "PED"); PreloadAnimLib(playerid, "SHOP"); #if defined actorrob_OnPlayerConnect actorrob_OnPlayerConnect(playerid); #endif return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((newkeys & KEY_AIM) == KEY_AIM && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { switch(GetPlayerWeapon(playerid)) { case 22 .. 33: { new actorid = GetPlayerCameraTargetActor(playerid); if(actorid == INVALID_ACTOR_ID) return 1; if(gettime() - soygun_data[actorid][actor_robbedRecently] < 60 * SOYGUN_GERI_SAYIM) return SoygunBaslangic(playerid, actorid, 1); soygun_data[actorid][actor_robbedRecently] = gettime(); AktorAnimasyon(playerid, actorid, 0); } } } #if defined actorrob_OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) #else return 1; #endif } //OnPlayerKeyStateChange hook şeklinde yapınız. #if defined _ALS_OnPlayerKeyStateChange #undef OnPlayerKeyStateChange #else #define _ALS_OnPlayerKeyState #endif #define OnPlayerKeyStateChange actorrob_OnPlayerKeyStateChange #if defined actorrob_OnPlayerKeyStateChange forward actorrob_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) #endif //OnPlayerConnect Bölümü #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect actorrob_OnPlayerConnect #if defined actorrob_OnPlayerConnect forward actorrob_OnPlayerConnect(playerid); #endif
Find difference