Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
TakTak :P
Créé
il y a 6 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
179 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
224 lignes
Copier tout
126 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
224 lignes
Copier tout
#if !defined _samp_included
#if !defined _samp_included
Copier
Copié
Copier
Copié
#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
Copier
Copié
Copier
Copié
#define KEY_AIM 128
#define KEY_AIM 128
#endif
#endif
#if !defined PreloadAnimLib
#if !defined PreloadAnimLib
Copier
Copié
Copier
Copié
#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
Copier
Copié
Copier
Copié
#define MAX_
ROBBERY_AC
TOR
S
(50)
#define MAX_
SOYGUN_AK
TOR
(50)
Copier
Copié
Copier
Copié
#define
TYPE_SUCCESS
(0)
#define
BASARILI_SOYGUN
(0)
#define
TYPE_FAILED
(1)
#define
BASARISIZ_SOYGUN
(1)
#define
TYPE_UNFINISHED
(2)
#define
SOYGUN_BITIRILMEDI
(2)
Copier
Copié
Copier
Copié
#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)
Copier
Copié
Copier
Copié
enum
E_AC
TOR_
ROBBERY_DATA
enum
AK
TOR_
SOYGUN
{
{
Copier
Copié
Copier
Copié
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,
Copier
Copié
Copier
Copié
bool:actor_created,
bool:actor_created,
actor_robbedRecently
actor_robbedRecently
}
}
Copier
Copié
Copier
Copié
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;
Copier
Copié
Copier
Copié
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);
Copier
Copié
Copier
Copié
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
)
{
{
Copier
Copié
Copier
Copié
new actorid =
GetActorFreeID
();
new actorid =
SoygunAktorID
();
Copier
Copié
Copier
Copié
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;
}
}
Copier
Copié
Copier
Copié
CreateActor(skinid, x, y, z, ang);
CreateActor(skinid, x, y, z, ang);
SetActorVirtualWorld(actorid, actor_vwid);
SetActorVirtualWorld(actorid, actor_vwid);
Copier
Copié
Copier
Copié
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;
Copier
Copié
Copier
Copié
return (++ i_actor - 1);
return (++ i_actor - 1);
}
}
Copier
Copié
Copier
Copié
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)
{
{
Copier
Copié
Copier
Copié
if(actorid == INVALID_ACTOR_ID)
if(actorid == INVALID_ACTOR_ID)
return 1;
return 1;
Copier
Copié
Copier
Copié
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;
}
}
Copier
Copié
Copier
Copié
static
GetActorFreeID()
static
SoygunAktorID()
{
{
Copier
Copié
Copier
Copié
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.
}
}
Copier
Copié
Copier
Copié
public
RunActorAnimationSequence
(playerid, actorid, animation_pattern)
public
AktorAnimasyon
(playerid, actorid, animation_pattern)
{
{
Copier
Copié
Copier
Copié
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);
}
Copier
Copié
Copier
Copié
}
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)
{
{
Copier
Copié
Copier
Copié
EnablePlayerCameraTarget(playerid, 1);
EnablePlayerCameraTarget(playerid, 1);
Copier
Copié
Copier
Copié
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "SHOP");
PreloadAnimLib(playerid, "SHOP");
Copier
Copié
Copier
Copié
#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)
{
{
Copier
Copié
Copier
Copié
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);
Copier
Copié
Copier
Copié
if(actorid == INVALID_ACTOR_ID)
if(actorid == INVALID_ACTOR_ID)
return 1;
return 1;
Copier
Copié
Copier
Copié
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);
Copier
Copié
Copier
Copié
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
}
}
Copier
Copié
Copier
Copié
//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
Copier
Copié
Copier
Copié
//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
Différences enregistrées
Texte d'origine
Ouvrir un fichier
#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
Texte modifié
Ouvrir un fichier
#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
Trouver la différence