PDA

View Full Version : Help with adding sided money to FS


iNkyz
25/06/2018, 07:36 PM
Hello, i have a FS for my server but i wan't to know how to add sided money to id, because every time i sell something i get the money but it reduces a few seconds after, and yes me server does have sided money.

/*_________________________________________________ _________________
| |
| Advance Fishing System [ Y_INI ] Script By FuNkY |
| ____ ____ ___ |
| |___ U N K Y | HE | __ R E A T |
| | | |___| |
|_________________________________________________ _________________|*/

#include <a_samp> // Thanks to SA-MP team for it
#include <zcmd> // Thanks to ZeeX for it
#include <streamer> // Thanks to Incognito for it
#include <YSI\y_ini> // Thanks to ****** for it
#include <sscanf2> // Thanks to Emmet_ for it

#define FOLDER "Fishes/%s.ini" // Folder where the data of players save
#define DIALOG_MSGs 69
#define DIALOG_SELLSHOP 70
#define DIALOG_BUYSHOP 71
#define fc "{DB881A}"
#define wc "{FFFFFF}"
#define red "{ff0000}"

//// ** FISH SELL ** ////

#define SFPRICE 1500
#define BFPRICE 2000
#define VBFPRICE 2500

//// ** FOR BUY ** ////

#define FRPRICE 1000
#define BPRICE 2000
enum PlayerData
{
SmallFish,
BigFish,
VBigFish,
Bait,
FishingRod
}
new User[MAX_PLAYERS][PlayerData];
new FishCP, FishCP1, FishCP2, FishCP3, FishCP4, FishCP5, SellShopCP , BuyShopCP;
new Timing[MAX_PLAYERS];
new Fish[MAX_PLAYERS];
new FishON[MAX_PLAYERS];
new FRod[MAX_PLAYERS];
new timeleft[MAX_PLAYERS];
new timer[MAX_PLAYERS];
public OnFilterScriptInit()
{
FishCP = CreateDynamicCP(-2947.6274,505.9880,2.4297,1.1,-1,-1,-1,50.0);
FishCP1 = CreateDynamicCP(-2946.6072,501.7512,2.4297,1.1,-1,-1,-1,50.0);
FishCP2 = CreateDynamicCP(-2949.0432,500.8602,2.4297,1.1,-1,-1,-1,50.0);
FishCP3 = CreateDynamicCP(-2975.9871,506.0298,2.4297,1.1,-1,-1,-1,50.0);
FishCP4 = CreateDynamicCP(-2974.6274,498.9590,2.4297,1.1,-1,-1,-1,50.0);
FishCP5 = CreateDynamicCP(-2977.2820,499.4622,2.4297,1.1,-1,-1,-1,50.0);
BuyShopCP = CreateDynamicCP(-2961.6135,481.9231,4.9098,1.1,-1,-1,-1,50.0);
SellShopCP = CreateDynamicCP(-2482.4253,775.1752,35.1786,1.0,-1,-1,-1,50.0);
Create3DTextLabel("Fishing", 0xFF0000FF, -2947.6274,505.9880,2.4297, 40.0, 0, 1);
Create3DTextLabel("Fishing", 0xFF0000FF, -2946.6072,501.7512,2.4297, 40.0, 0, 1);
Create3DTextLabel("Fishing", 0xFF0000FF, -2949.0432,500.8602,2.4297, 40.0, 0, 1);
Create3DTextLabel("Fishing", 0xFF0000FF, -2975.9871,506.0298,2.4297, 40.0, 0, 1);
Create3DTextLabel("Fishing", 0xFF0000FF, -2974.6274,498.9590,2.4297, 40.0, 0, 1);
Create3DTextLabel("Fishing", 0xFF0000FF, -2977.2820,499.4622,2.4297, 40.0, 0, 1);
Create3DTextLabel("Buying Shop", 0xFF0000FF, -2961.6135,481.9231,4.9098, 40.0, 0, 1);
Create3DTextLabel("Selling Shop", 0xFF0000FF, -2482.4253,775.1752,35.1786, 40.0, 0, 1);
print("\n--------------------------------------");
print(" Advance Fishing System by FuNkYTheGreat");
print(" ----- LOADED -----" );
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Advance Fishing System by FuNkYTheGreat");
print(" ----- UN-LOADED -----" );
print("--------------------------------------\n");
return 1;
}
CMD:fstats(playerid, params[])
{
new tid,string[128];

if(!sscanf(params, "u", tid))
{
if(tid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""red"Player not connected.");
ShowFishStats(playerid, tid);
format(string, sizeof(string), ""fc"[FISHING-STATS] "wc"%s's Stats.", GetName(tid));
SendClientMessage(playerid, -1, string);
}
else
{
ShowFishStats(playerid, playerid);
SendClientMessage(playerid, -1, ""fc"[FISHING-STATS] "wc"You can also use /stats ( playerid ).");
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(fexist(Root(playerid)))
{
INI_ParseFile(Root(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
new INI:file = INI_Open(Root(playerid));
INI_WriteInt(file, "SmallFish", User[playerid][SmallFish]);
INI_WriteInt(file, "BigFish", User[playerid][BigFish]);
INI_WriteInt(file, "VBigFish", User[playerid][VBigFish]);
INI_WriteInt(file, "FishindRods",User[playerid][FishingRod]);
INI_WriteInt(file, "Bait",User[playerid][Bait]);

INI_ParseFile(Root(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
INI_Close(file);
}
return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
if(fexist(Root(playerid)))
{
new INI:file = INI_Open(Root(playerid));
INI_WriteInt(file, "SmallFish", User[playerid][SmallFish]);
INI_WriteInt(file, "BigFish",User[playerid][BigFish]);
INI_WriteInt(file, "VBigFish", User[playerid][VBigFish]);
INI_WriteInt(file, "FishindRods",User[playerid][FishingRod]);
INI_WriteInt(file, "Bait",User[playerid][Bait]);
INI_Close(file);
}
User[playerid][SmallFish] = 0;
User[playerid][BigFish] = 0;
User[playerid][VBigFish] = 0;
User[playerid][FishingRod] = 0;
User[playerid][Bait] = 0;
Timing[playerid]= 0;
Fish[playerid]= 0;
FishON[playerid]= 0;
FRod[playerid]= 0;
timeleft[playerid] = 0;
timer[playerid] = 0;
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
new string[250];
if(checkpointid == FishCP)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
if(checkpointid == FishCP1)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
if(checkpointid == FishCP2)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
if(checkpointid == FishCP3)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
if(checkpointid == FishCP4)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
if(checkpointid == FishCP5)
{
if(User[playerid][Bait] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Bait to Start Fishing");
if(User[playerid][FishingRod] == 0 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You didn't have any Fishing Rods to Start Fishing");
if(FishON[playerid] == 1 ) return SendClientMessage(playerid, -1 ,""fc"[FISHING]"wc" You have to wait 15 Minutes to Start fishing again");
SendClientMessage( playerid, -1 ,""fc"[FISHING] "wc"You have start Fishing!");
Timing[playerid] = SetTimerEx("Timer",30000,1,"i",playerid);
Fish[playerid] = 1;
FRod[playerid]++;
User[playerid][Bait]--;
timeleft[playerid] = 30;
timer[playerid] = SetTimerEx("tLeft",900,1,"i",playerid);
TogglePlayerControllable(playerid , false);
SetPlayerAttachedObject( playerid, 0, 18632, 1, -0.091109, 0.255484, 0.018155, 94.362060, 312.328125, 190.418655, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
FishON[playerid] = 1;
SetTimerEx("WaitTime",900000, 0, "d", playerid);
if(FRod[playerid] == 5 )
{
User[playerid][FishingRod]--;
FRod[playerid] = 5;
}
}
else if(checkpointid == BuyShopCP)
{
format(string, sizeof(string), ""fc"Buy Fishing Rods\n"fc"Buy Bait");
ShowPlayerDialog(playerid, DIALOG_BUYSHOP, DIALOG_STYLE_LIST, "Buying Shop",string, "Buy", "Exit");
}
else if(checkpointid == SellShopCP)
{
format(string, sizeof(string), ""fc"Sell Small Fish "wc"%d \n"fc"Sell Big Fish "wc"%d \n"fc"Sell Very Big Fish "wc"%d",User[playerid][SmallFish],User[playerid][BigFish],User[playerid][VBigFish]);
ShowPlayerDialog(playerid, DIALOG_SELLSHOP, DIALOG_STYLE_LIST, "Selling Shop",string, "Buy", "Exit");
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_SELLSHOP)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(User[playerid][SmallFish] >= 1)
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You have succesfully selled a Small Fish!");
GivePlayerMoney(playerid,SFPRICE);
User[playerid][SmallFish]--;
}
else
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You didn't have enough Small Fish to sell!");
}
}
case 1:
{
if(User[playerid][BigFish] >= 1)
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You have succesfully selled a Big Fish!");
GivePlayerMoney(playerid,BFPRICE);
User[playerid][BigFish]--;
}
else
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You didn't have enough Big Fish to sell!");
}
}
case 2:
{
if(User[playerid][VBigFish] >= 1)
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You have succesfully selled a Very Big Fish!");
GivePlayerMoney(playerid,VBFPRICE);
User[playerid][VBigFish]--;
}
else
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You didn't have enough Very Big Fish to sell!");
}
}
}
}
}
if(dialogid == DIALOG_BUYSHOP)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) >= FRPRICE)
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You have succesfully buy a Fishing Rod!");
GivePlayerMoney(playerid,-FRPRICE);
User[playerid][FishingRod]++;
}
else
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You didn't have enough money to buy a Fishing Rod!");
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= BPRICE)
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You have succesfully buy a Bait!");
GivePlayerMoney(playerid,-BPRICE);
User[playerid][Bait]++;

}
else
{
SendClientMessage( playerid, -1 ,""fc"[FISHING]"wc" You didn't have enough money to buy a Bait!");
}
}
}
}
}
return 0;
}
forward ShowFishStats(playerid, targetid);
public ShowFishStats(playerid, targetid)
{
new string[1500], string2[1500];
format(string, sizeof(string), ""fc"Small Fishes: "wc"%d\n", User[playerid][SmallFish]);
strcat(string2, string);
format(string, sizeof(string), ""fc"Big Fishes: "wc"%d\n", User[playerid][BigFish]);
strcat(string2, string);
format(string, sizeof(string), ""fc"Very Big Fishes: "wc"%d\n", User[playerid][VBigFish]);
strcat(string2, string);
format(string, sizeof(string), ""fc"Fishing Rods: "wc"%d\n", User[playerid][FishingRod]);
strcat(string2, string);
format(string, sizeof(string), ""fc"Bait: "wc"%d\n", User[playerid][Bait]);
strcat(string2, string);
ShowPlayerDialog(playerid, DIALOG_MSGs , DIALOG_STYLE_MSGBOX, "Fishing Stats", string2, "Close", "");
return 1;
}
forward Timer(playerid);
public Timer(playerid)
{
new fishes = 1 + random(10);
new string[250];
switch( random( 6 ) )
{
case 0,1,2,3:
{
format(string, sizeof(string), ""fc"[FISHING] "wc"%s Has Caught "fc"%d"wc" Small Fishes",GetName(playerid),fishes);
SendClientMessageToAll(-1 , string);
format(string, sizeof(string), ""fc"[FISHING] "wc"You have Caught "fc"%d"wc" Small Fishes",fishes);
SendClientMessage(playerid, -1 , string);
User[playerid][SmallFish]+=fishes;
}
case 4,5:
{
format(string, sizeof(string), ""fc"[FISHING] "wc"%s Has Caught "fc"%d"wc" Big Fishes",GetName(playerid),fishes);
SendClientMessageToAll(-1 , string);
format(string, sizeof(string), ""fc"[FISHING] "wc"You have Caught "fc"%d"wc" Big Fishes",fishes);
SendClientMessage(playerid, -1 , string);
User[playerid][BigFish]+=fishes;
}
case 6:
{
format(string, sizeof(string), ""fc"[FISHING] "wc"%s Has Caught "fc"%d"wc" Very Big Fishes",GetName(playerid),fishes);
SendClientMessageToAll(-1 , string);
format(string, sizeof(string), ""fc"[FISHING] "wc"You have Caught "fc"%d"wc" Very Big Fishes",fishes);
SendClientMessage(playerid, -1 , string);
User[playerid][VBigFish]+=fishes;
}
}
GameTextForPlayer(playerid, "~r~Fishing ~y~Complete!", 5000, 3);
ClearAnimations(playerid);
Fish[playerid] = 0;
KillTimer(Timing[playerid]);
TogglePlayerControllable(playerid , true);
RemovePlayerAttachedObject(playerid, 0);
return 1;
}
forward WaitTime(playerid);
public WaitTime(playerid)
{
FishON[playerid] = 0;
return 1;
}
forward LoadUser_data(playerid, name[], value[]);
public LoadUser_data(playerid, name[], value[])
{
INI_Int("SmallFish", User[playerid][SmallFish]);
INI_Int("BigFish",User[playerid][BigFish]);
INI_Int("VBigFish", User[playerid][VBigFish]);
INI_Int("FishindRods",User[playerid][FishingRod]);
INI_Int("Bait",User[playerid][Bait]);
return 1;
}
Root(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
format(string,sizeof(string),FOLDER,playername);
return string;
}
GetName(playerid)
{
new pName[24];
GetPlayerName(playerid, pName, 24);
return pName;
}
forward tLeft(playerid);
public tLeft(playerid)
{
timeleft[playerid]--;
new string[128];
format(string, 128, "~r~TIME LEFT ~b~: %d", timeleft[playerid]);
GameTextForPlayer(playerid, string , 900, 3);
if (timeleft[playerid] == 1)
{
KillTimer(timer[playerid]);
}
return 1;
}



Credit to the FS owner i just modded the Cp's and added more fishing sopt's

Jing_Chan
26/06/2018, 11:05 AM
You'd be better off integrating this code into the main script, and not using it as a filterscript. Once you do that you can review parts of the main code and see how the rest of the script dispenses server sided money, and altering your fishing code to dispense server sided money in the same way.

GTLS
26/06/2018, 03:02 PM
This is a filterscript. You will have to add your Server Sided Money function code into this and use it instead of default one. Search your GM for what function you're using.

iNkyz
26/06/2018, 07:58 PM
Where do i look for it? im very new to scripting.

iNkyz
27/06/2018, 12:48 AM
HEEEEEEEEEEEEEELP!

Verc
27/06/2018, 03:42 AM
Don't bump before 24 hours.
The first reply clearly said it,you better integrate this code to your gamemode.

GTLS
27/06/2018, 08:42 AM
Where do i look for it? im very new to scripting.

press ctrl+F inside your script and look for the function heading which gives you server sided money. Copy that code and paste it inside the FS and use that function to give money.

iNkyz
27/06/2018, 11:10 AM
C:\Users\BiNcE\Desktop\CNRSF\filterscripts\fFish.p wn(318) : error 017: undefined symbol "GiveMoney"
C:\Users\BiNcE\Desktop\CNRSF\filterscripts\fFish.p wn(331) : error 017: undefined symbol "GiveMoney"
C:\Users\BiNcE\Desktop\CNRSF\filterscripts\fFish.p wn(344) : error 017: undefined symbol "GiveMoney"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.

Verc
27/06/2018, 11:37 AM
Migrate the code into your gamemode.

Akeem
27/06/2018, 03:16 PM
In your server main code there should be a user defined function to give player money, find the function and put it into your filterscript amd make your filterscript and inc to the main script.

iNkyz
27/06/2018, 06:58 PM
Is there any tutorial on how to migrate FS to GM, as i said, im new to this.

Calisthenics
27/06/2018, 07:02 PM
There are ways to make them "share" data: http://forum.sa-mp.com/showthread.php?t=261584

trablon
27/06/2018, 07:14 PM
You can check my thread about it.

http://forum.sa-mp.com/showthread.php?t=655707

iNkyz
27/06/2018, 09:09 PM
/********************************
++ California Cops and RObbers ++
++ By Bondowocopz ++
********************************/
// #define istest 1 // Uncomment This Line If You Want To Use Some Test Command On Test.inc
#define USE_SOCKET 1 // Uncomment this line if you want to use socket
#define OK 1
#define USE_037 1 // Uncomment this line if you want to use 0.3.7
#include <a_samp>
#include <required/ELC_AC_BASE>
#include <a_mysql>
#include <a_sampdb>
#include <cnr/define>
#include <streamer>
#include <required/sscanf2>
#include <required/gate>
#include <foreach>
#include <required/color>
#include <required/ipcheck>
#include <required/zcmd>
#include <required/mSelection>
#include <required/cuff>
#include <required/OPSP>
#include <required/progress2>
#include <required/floodcontrol>
#include <required/afk>
#include <mapandreas>
#include <required/callback>
#include <cnr/new>
#if defined USE_037
#include <cnr/actor>
#endif
#include <cnr/house>
#include <cnr/zone>
#include <cnr/player>
#if defined USE_SOCKET
#include <required/socket>
#endif
#include <cnr/socket>
#include <cnr/toys>
#include <cnr/gps>
#include <cnr/dealership>
#include <cnr/truck>
#include <cnr/gang>
#include <cnr/gangzone>
#include <cnr/locker>
#include <cnr/stock>
#include <cnr/derby>
#include <cnr/dm>
#include <cnr/fallout>
#include <cnr/moneybag>
#include <cnr/rob>
#include <cnr/garage>
#include <cnr/function>
#include <cnr/public>
#include <cnr/store>
#include <cnr/cp>
#include <cnr/roadblock>
#include <cnr/class>
#include <cnr/explosive>
#include <cnr/object>
#include <cnr/dialog>
#include <cnr/admin>
#include <cnr/command>
#include <cnr/textdraw>
#include <cnr/anims>
#if defined istest
#include <cnr/test>
#endif

#if USE_ANTI_STEALER == true

#define DISALLOWED_ADDRESS "DA0E5085558CCACC88ECCA40C4CEC49A9408EEE8"
native gpci( playerid , const serial[] , maxlen );

#endif

main()
{
print("\n-----------------------------------------");
print(" California Cops and Robbers by Bondowocopz");
print("-----------------------------------------\n");
}

public OnGameModeInit()
{
mysql_log(LOG_ERROR | LOG_WARNING, LOG_TYPE_HTML);
if(fexist("LOCALHOST"))
{
koneksi = mysql_connect(HOST, USER, DBNAME, PASSWORD);
// forum = mysql_connect(HOST, USER, FORUMDB, PASSWORD);
}
else
{
koneksi = mysql_connect(HOST2, USER2, DBNAME2, PASSWORD2);
// forum = mysql_connect(HOST2, USER2, FORUMDB, PASSWORD2);
}
mysql_stat(sqlStat, koneksi);
printf("Mysql Status : \n%s", sqlStat);
MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
SetTimer("globalTimer", 1000, true);
SetTimer("swapMotd", 30000, true);
SetTimer("placeMoneybag", 900000, true);
//SetTimer("ACTimer", 5000, true);

/* GPS SYSTEM */
if(!fexist(GPSFile))
{
fcreate(GPSFile);
}
GPSDB = db_open(GPSFile);
LoadFGPS();
/*************/

/* Function */
resetServer();
#if defined USE_SOCKET
initSocket();
#endif
loadObject();
addClass(); // Add player classes
CreateTD();
loadGangZone();
loadStore();
#if defined USE_037
loadActor();
#endif
loadlockerData();
loadRobbery();
initCP();
loadServerVeh();
loadHouses();
loadInt();
//antibadWord();
loadGang();
// loadTruck();
loadGarage();
/************/
EnableStuntBonusForAll(0);
UsePlayerPedAnims();
DisableInteriorEnterExits();
SetWeather(7);
SetGameModeText("Cops and Robbers");
SendRconCommand("mapname San Fierro");
return 1;
}

public OnGameModeExit()
{
for(new i = 0; i < MAX_GANGS; i++)
{
if(Gang[i][gangStatus])
{
saveGang(i);
}
}
foreach(new i : Player)
{
if(Player[i][isSpawned])
saveStats(i);
}
#if defined USE_SOCKET
socket_stop_listen(gSocket);
socket_destroy(gSocket);
#endif
mysql_close();
db_close(GPSDB);
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
new Float:spawnX, Float:spawnY, Float:spawnZ;
spawnX = -1967.5838;
spawnY = 136.1628;
spawnZ = 27.6875;
ClearAnimations(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
SetPlayerCameraPos(playerid, spawnX + 5.0, spawnY +3.0, spawnZ + 2.00);
SetPlayerCameraLookAt(playerid, spawnX, spawnY, spawnZ);
SetPlayerFacingAngle(playerid, -90.0000);
switch(classid)
{
case 0 .. 34:
{
SetPlayerTeam(playerid, NO_TEAM);
Player[playerid][playerClass] = CIVILIAN;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "NO REQUIRETMENTS");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "CIVILS");
if(Player[playerid][english])
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Rob store and kill players");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "to earn XP and rule the");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], "streets.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "Complete mission to get XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], "or money.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
else
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Rampok toko dan bunuh");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "player lain agar mendapatkan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], "XP dan kuasai permainan.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "Selesaikan misi dan dapatkan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], "XP ataupun uang.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
SetPlayerColor(playerid, CLASS_CIVILIAN_COLOR);
}
case 35 .. 43:
{
SetPlayerTeam(playerid, LEO);
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "500 XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "POLICE");
Player[playerid][playerClass] = POLICE;
if(Player[playerid][english])
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Bring criminals to justice");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "using an array of tools.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Hunt down and arrest");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "criminals for cash and XP.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
else
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Tangkap kriminal dan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "berantas kejahatan.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Bunuh dan tangkap");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "kriminal untuk uang dan XP.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
SetPlayerColor(playerid, CLASS_POLICE_COLOR);
}
case 44 .. 45:
{
SetPlayerTeam(playerid, LEO);
Player[playerid][playerClass] = ARMY;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "40000 XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "ARMY");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "Access powerful weaponry");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], "& machineryto kill");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "those criminal bastards.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], "Hunt down and arrest");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], "criminals for cash and XP.");
SetPlayerColor(playerid, CLASS_ARMY_COLOR);
}
case 46 .. 49:
{
SetPlayerTeam(playerid, LEO);
Player[playerid][playerClass] = CIA;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "30000 XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "CIA");
if(Player[playerid][english])
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Bring criminals to justice");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "using an array of tools.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Gain the ability to locate");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "and EMP criminals.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
else
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Tangkap kriminal dan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "berantas kejahatan.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Dapatkan kekuatan untuk");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "mencari dan EMP kriminal.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
SetPlayerColor(playerid, CLASS_CIA_COLOR);
}
case 50 .. 51:
{
SetPlayerTeam(playerid, LEO);
Player[playerid][playerClass] = FBI;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "20000 XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "FBI");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Bring criminals to justice");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "using an array of tools.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Gain the ability to force");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "entry to any property.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
SetPlayerColor(playerid, CLASS_FBI_COLOR);
}
case 52 .. 54:
{
SetPlayerTeam(playerid, NO_TEAM);
Player[playerid][playerClass] = MEDIC;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "200 XP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "MEDIC");
if(Player[playerid][english])
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Heal players and Cure");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "HIV to get money and XP.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
else
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Obati player lain dan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "sembuhkan player yang");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], "terkena HIV dan dapatkan.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "uang dan XP.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
SetPlayerColor(playerid, CLASS_MEDIC_COLOR);
}
case 55 .. 57:
{
SetPlayerTeam(playerid, LEO);
Player[playerid][playerClass] = SPY;
PlayerTextDrawColor(playerid, Player[playerid][classSelectTD][8], 16777215);
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][8], "VIP MEMBERSHIP");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][0], "SPY");
if(Player[playerid][english])
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Bring criminals to justice");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "using an array of tools.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Become incognito and hide");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "in the shadows.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
else
{
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][1], "Tangkap kriminal dan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][2], "berantas kejahatan.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][3], " ");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][4], "Bersembunyi dalam bayangan");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][5], "agar player lain tidak bisa");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][6], "melihatmu.");
PlayerTextDrawSetString(playerid, Player[playerid][classSelectTD][7], " ");
}
SetPlayerColor(playerid, CLASS_SPY_COLOR);
}
}
TextDrawShowForPlayer(playerid, GM[classonTD][0]);
TextDrawShowForPlayer(playerid, GM[classonTD][1]);
TextDrawShowForPlayer(playerid, GM[classonTD][2]);
TextDrawShowForPlayer(playerid, GM[classonTD][3]);
TextDrawShowForPlayer(playerid, GM[classonTD][4]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][0]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][1]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][2]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][3]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][4]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][5]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][6]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][7]);
PlayerTextDrawShow(playerid, Player[playerid][classSelectTD][8]);
ApplyAnimation(playerid,"PED","SEAT_down", 4.1, 0, 1, 1, 1, 1, 0);
Player[playerid][isSpawned] = false;
return 1;
}

public OnPlayerConnect(playerid)
{
#if USE_ANTI_STEALER == true
new str[ 100 ];
gpci( playerid , str , sizeof( str ) );
if( !strcmp( str , DISALLOWED_ADDRESS ,true ) )
{
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Map Stealer", CHAT_RED"570P US1NG M4P 5T34L3R M07H3RFUCK3R, FUCK 0FF.", "1M 7H3 R34L FUCK3R5", "");
BanEx( playerid, "# Map Stealer / RakSampClient" );
}
#endif
Player[playerid][playerClass] = CIVILIAN;
RemoveBuildingForPlayer(playerid, 705, -2393.5547, 103.0938, 34.5938, 0.25);
RemoveBuildingForPlayer(playerid, 705, -2388.2422, 148.9844, 34.5938, 0.25);
RemoveBuildingForPlayer(playerid, 705, -2368.0703, 83.7578, 34.5938, 0.25);
RemoveBuildingForPlayer(playerid, 708, -2394.0313, 69.6641, 34.6328, 0.25);
RemoveBuildingForPlayer(playerid, 705, -2405.9609, 81.8594, 34.2266, 0.25);
RemoveBuildingForPlayer(playerid, 3831, -2784.6719, 184.0078, 10.7266, 0.25);
RemoveBuildingForPlayer(playerid, 3835, -2786.0547, 194.0078, 9.4688, 0.25);
RemoveBuildingForPlayer(playerid, 3836, -2787.6563, 203.2891, 10.8906, 0.25);
RemoveBuildingForPlayer(playerid, 3841, -2788.1172, 221.4141, 10.8906, 0.25);
RemoveBuildingForPlayer(playerid, 3846, -2786.7266, 212.3516, 12.3906, 0.25);
RemoveBuildingForPlayer(playerid, 10578, -2779.8125, 196.7031, 6.7500, 0.25);
RemoveBuildingForPlayer(playerid, 669, -2404.1953, 61.5859, 34.3516, 0.25);
RemoveBuildingForPlayer(playerid, 1446, -2795.2344, 198.8984, 6.9922, 0.25);
RemoveBuildingForPlayer(playerid, 1446, -2793.6797, 188.9297, 6.9922, 0.25);
RemoveBuildingForPlayer(playerid, 10734, -2788.4609, 191.7500, 17.5078, 0.25);
RemoveBuildingForPlayer(playerid, 3820, -2784.6719, 184.0078, 10.7266, 0.25);
RemoveBuildingForPlayer(playerid, 3824, -2786.0547, 194.0078, 9.4688, 0.25);
RemoveBuildingForPlayer(playerid, 3830, -2787.6563, 203.2891, 10.8906, 0.25);
RemoveBuildingForPlayer(playerid, 10422, -2779.8125, 196.7031, 6.7500, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2777.5234, 199.0547, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2777.0703, 189.1172, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 10682, -2779.9141, 171.8750, 7.2891, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2774.0078, 199.0547, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2773.5547, 189.1172, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2770.4922, 199.0547, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2766.9766, 199.0547, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2770.0391, 189.1172, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2766.5234, 189.1172, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 3825, -2788.1172, 221.4141, 10.8906, 0.25);
RemoveBuildingForPlayer(playerid, 3845, -2786.7266, 212.3516, 12.3906, 0.25);
RemoveBuildingForPlayer(playerid, 1446, -2795.1563, 207.6250, 6.9922, 0.25);
RemoveBuildingForPlayer(playerid, 1446, -2795.2578, 217.1797, 6.9922, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2771.2031, 217.1094, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2774.7188, 217.1094, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2778.2344, 217.1094, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2778.2344, 207.6250, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2774.7188, 207.6250, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2771.2031, 207.6250, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2764.1719, 217.1094, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2767.6875, 217.1094, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2767.6875, 207.6250, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2764.1719, 207.6250, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2763.4609, 199.0547, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1418, -2763.0078, 189.1172, 6.9609, 0.25);
RemoveBuildingForPlayer(playerid, 1308, -2761.2891, 206.3750, 6.1094, 0.25);
RemoveBuildingForPlayer(playerid, 10954, -2051.5391, -444.1563, 53.8281, 0.25);
RemoveBuildingForPlayer(playerid, 10955, -2051.5391, -444.1563, 53.8281, 0.25);
RemoveBuildingForPlayer(playerid, 11049, -2051.5391, -444.1563, 53.8281, 0.25);
RemoveBuildingForPlayer(playerid, 11397, -2051.5391, -444.1563, 53.8281, 0.25);
RemoveBuildingForPlayer(playerid, 1232, -2238.5859, 521.4063, 36.7266, 0.25);
RemoveBuildingForPlayer(playerid, 11017, -2072.5781, 534.3203, 56.5938, 0.25);
RemoveBuildingForPlayer(playerid, 11036, -2143.9688, -9.2891, 42.5938, 0.25);
RemoveBuildingForPlayer(playerid, 11037, -2147.2969, -49.7031, 36.5000, 0.25);
RemoveBuildingForPlayer(playerid, 11038, -2124.6953, -60.3516, 40.2969, 0.25);
RemoveBuildingForPlayer(playerid, 11039, -2055.3594, -54.0078, 40.2969, 0.25);
RemoveBuildingForPlayer(playerid, 11162, -2111.2578, 11.0625, 37.3906, 0.25);
RemoveBuildingForPlayer(playerid, 11163, -2110.8281, -27.3594, 36.9766, 0.25);
RemoveBuildingForPlayer(playerid, 11164, -2061.5547, -16.2422, 40.2813, 0.25);
RemoveBuildingForPlayer(playerid, 11245, -2023.7109, 83.9688, 37.8750, 0.25);
RemoveBuildingForPlayer(playerid, 11272, -2037.5391, 79.9297, 34.1094, 0.25);
RemoveBuildingForPlayer(playerid, 3869, -2116.6797, 131.0078, 42.1484, 0.25);
RemoveBuildingForPlayer(playerid, 3888, -2128.1797, 171.4609, 42.4297, 0.25);
RemoveBuildingForPlayer(playerid, 10925, -2072.5781, 534.3203, 56.5938, 0.25);
RemoveBuildingForPlayer(playerid, 10996, -2147.2969, -49.7031, 36.5000, 0.25);
RemoveBuildingForPlayer(playerid, 10991, -2143.9688, -9.2891, 42.5938, 0.25);
RemoveBuildingForPlayer(playerid, 10992, -2124.6953, -60.3516, 40.2969, 0.25);
RemoveBuildingForPlayer(playerid, 11092, -2110.8281, -27.3594, 36.9766, 0.25);
RemoveBuildingForPlayer(playerid, 11002, -2061.5547, -16.2422, 40.2813, 0.25);
RemoveBuildingForPlayer(playerid, 11093, -2111.2578, 11.0625, 37.3906, 0.25);
RemoveBuildingForPlayer(playerid, 3887, -2128.1797, 171.4609, 42.4297, 0.25);
RemoveBuildingForPlayer(playerid, 3866, -2116.6797, 131.0078, 42.1484, 0.25);
RemoveBuildingForPlayer(playerid, 3864, -2082.5391, 153.5469, 40.1016, 0.25);
RemoveBuildingForPlayer(playerid, 3872, -2079.8203, 159.6719, 40.8906, 0.25);
RemoveBuildingForPlayer(playerid, 10982, -2055.3594, -54.0078, 40.2969, 0.25);
RemoveBuildingForPlayer(playerid, 11008, -2037.5391, 79.9297, 34.1094, 0.25);
RemoveBuildingForPlayer(playerid, 13007, 2312.7031, -9.0625, 27.5313, 0.25);
RemoveBuildingForPlayer(playerid, 968, -1526.4375, 481.3828, 6.9063, 0.25);
RemoveBuildingForPlayer(playerid, 966, -1526.3906, 481.3828, 6.1797, 0.25);
RemoveBuildingForPlayer(playerid, 966, -1572.2031, 658.8359, 6.0781, 0.25);
RemoveBuildingForPlayer(playerid, 967, -1572.7031, 657.6016, 6.0781, 0.25);
RemoveBuildingForPlayer(playerid, 11102, -2102.9297, -16.0547, 36.4844, 0.25);
new query[128];
#if defined USE_SOCKET
sendToClients(gQuery);
#endif
animInit(playerid);
resetStats(playerid);
//RemoveVendingMachines(playerid);
/* Check player if exist in DB */
if(!isBanned(playerid))
{
Player[playerid][sqlCheck]++; // Variable to avoid bug appear, and to check every query
mysql_format(koneksi, query, sizeof(query), "SELECT * FROM `player` WHERE `name` = '%s' LIMIT 1", safeString(Player[playerid][Name]));
mysql_tquery(koneksi, query, "OnPlayerLoadData", "dd", playerid, Player[playerid][sqlCheck]);
}
new grID;
for(new x = 0; x < MAX_GANG_ZONES; x++)
{
if(GZone[x][gzoneOwner] == -1)
{
GangZoneShowForPlayer(playerid, GZone[x][gZone], HexToInt(CHAT_ADMIN"CC"));
}
else
{
new col[10];
grID = findGang(GZone[x][gzoneOwner], false);
format(col, sizeof(col), "%sCC", Gang[grID][gangColor]);
GangZoneShowForPlayer(playerid, GZone[x][gZone], HexToInt(col));
if(GZone[x][gzoneAttack])
{
GangZoneFlashForPlayer(playerid, GZone[x][gZone], HexToInt(CHAT_RED"CC"));
}
}
}
/*******************************/
SendDeathMessage(INVALID_PLAYER_ID, playerid, 200);
TextDrawShowForPlayer(playerid, GM[loginTD][0]);
TextDrawShowForPlayer(playerid, GM[loginTD][1]);
TextDrawShowForPlayer(playerid, GM[loginTD][2]);
TextDrawShowForPlayer(playerid, GM[loginTD][3]);
format(query, sizeof(query), "%s has been logged in.", GetName(playerid));
TextDrawColor(GM[loginTD][4], 16711935);
TextDrawSetString(GM[loginTD][4], query);
TextDrawShowForAll(GM[loginTD][4]);
GM[player_count]++;
#if defined USE_SOCKET
format(gQuery, sizeof(gQuery), "con:%d:%s", playerid, GetName(playerid));
sendToClients(gQuery);
#endif
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
for(new x = 0; x < MAX_OSLOTS; x++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, x))
{
RemovePlayerAttachedObject(playerid, x);
}
}
Player[playerid][onFallout] = false;
removePlayerRoadblocks(playerid);
Player[playerid][usingAnim] = false;
if (Player[playerid][useBackpack])
{
if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
}
Delete3DTextLabel(Player[playerid][playerLabel]);
Delete3DTextLabel(Player[playerid][kidnapLabel]);
Delete3DTextLabel(Player[playerid][spawnLabel]);
Delete3DTextLabel(Player[playerid][titleLabel]);
Player[playerid][hasRaped] = false;
if(inTied(playerid))
{
new report[512];
format(report, sizeof(report), CHAT_RED"%s quit game while tied.", GetName(playerid));
SRM(report);
}
if(isCuffed(playerid))
{
new report[512];
format(report, sizeof(report), CHAT_RED"%s quit game while cuffed.", GetName(playerid));
SRM(report);
}
if(Player[playerid][truckingMission])
{
Server(playerid, "Trucking mission failed.");
Player[playerid][truckID] = -1;
Player[playerid][truckingMission] = false;
Player[playerid][truckLoaded] = false;
RemovePlayerMapIcon(playerid, 69);
}
KillTimer(Player[playerid][rapedTimer]);
KillTimer(Player[playerid][tieTimer]);
if(Player[playerid][attackLeft] > 0)
{
new msg[1000], gID = findGang(playerid), z = Player[playerid][attackZone];
Player[playerid][attackZone] = -1;
format(msg, sizeof(msg), CHAT_GANG"[GANG-ZONE] "CHAT_WHITE"%s failed to capture %s and gangzone will be locked for 15 minutes.", GetName(playerid), GetXY2DZone(GZone[z][gzoneCPPos][0], GZone[z][gzoneCPPos][1]));
SendClientMessageToAll(COLOR_WHITE, msg);
KillTimer(Player[playerid][attackTimer]);
PlayerTextDrawHide(playerid, Player[playerid][gangzoneTD][1]);
PlayerTextDrawHide(playerid, Player[playerid][gangzoneTD][0]);
GangZoneStopFlashForAll(GZone[z][gZone]);
GZone[z][gzoneAttack] = false;
GZone[z][gzoneLocked] = true;
GZone[z][gzoneTime] = 900;
Gang[gID][gangAttack] = false;
Player[playerid][onAttack] = false;
Player[playerid][attackLeft] = 0;
}
if(IsValidDynamic3DTextLabel(Player[playerid][spawnLabel]))
{
DestroyDynamic3DTextLabel(Player[playerid][spawnLabel]);
}
if(Player[playerid][cuffed])
{
SetPlayerCuffed(playerid, false);
Player[playerid][cuffed] = false;
}
disableGPS(playerid);
new msg[128];
KillTimer(Player[playerid][jailTimer]);
KillTimer(Player[playerid][saveTimer]);

if(Player[playerid][isSpawned])
saveStats(playerid);

if(Player[playerid][checkpointRobs] != -1)
forceendRobbery(playerid);

if(GetPVarInt(playerid,"roped") == 1)
{
for(new i = 0; i <= ROPELENGTH; i++) // Loop for destroy rope object
{
DestroyObject(Player[playerid][rope][i]);
}
}

destroyCar(playerid);
resetStats(playerid);
KillTimer(Player[playerid][timerSpeed]);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
format(msg, sizeof(msg), "%s has been logged out.", GetName(playerid));
TextDrawColor(GM[loginTD][4], -16776961);
TextDrawSetString(GM[loginTD][4], msg);
TextDrawShowForAll(GM[loginTD][4]);
GM[player_count]--;
#if defined USE_SOCKET
format(gQuery, sizeof(gQuery), "dcon:%d:%s:%d", playerid, GetName(playerid), reason);
sendToClients(gQuery);
#endif
return 1;
}

public OnPlayerSpawn(playerid)
{
Player[playerid][onFallout] = false;
for(new x = 0; x < MAX_OSLOTS; x++)
{
if(Player[playerid][toyStatus][x])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid, x))
{
SetPlayerAttachedObject(playerid, x, Player[playerid][toyID][x], Player[playerid][toyBone][x], Player[playerid][toyPosX][x], Player[playerid][toyPosY][x], Player[playerid][toyPosZ][x], Player[playerid][toyRotX][x], Player[playerid][toyRotY][x], Player[playerid][toyRotZ][x], Player[playerid][toyScaleX][x], Player[playerid][toyScaleY][x], Player[playerid][toyScaleZ][x]);
}
}
}
removePlayerRoadblocks(playerid);
if(Player[playerid][usingAnim])
{
showTextdraw(playerid);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
Player[playerid][usingAnim] = false;
}
Player[playerid][onDM] = false;
Player[playerid][onDerby] = false;
if(Player[playerid][isSpec])
{
loadData(playerid);
Player[playerid][isSpec] = false;
return 1;
}
new msg[1000];
if(Player[playerid][onDuty])
removeDuty(playerid);

Delete3DTextLabel(Player[playerid][spawnLabel]);
if(Player[playerid][jailTime] > 0)
{
jail(playerid);
format(msg, sizeof(msg), CHAT_YELLOW"%s"CHAT_WHITE" has been jailed. "CHAT_YELLOW"(Sentence Incomplete)", GetName(playerid));
foreach(new i : Player)
{
Server(i, msg);
}
}
if(Player[playerid][playerSkin] != -1)
{
SetPlayerSkin(playerid, Player[playerid][playerSkin]);
Server(playerid, "You've spawned with custom skin, to remove this skin type "CHAT_YELLOW"/ucp"CHAT_WHITE".");
}
Player[playerid][lastHouse] = -1;
Player[playerid][lastGarage]= -1;
if(Player[playerid][playerJob] == 0)
{
if(Player[playerid][english])
{
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Mechanic "CHAT_WHITE"- Repair and Remove EMP from player Vehicle to get XP and Money.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Rapist "CHAT_WHITE" - Rape players and give them HIV.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Terrorist "CHAT_WHITE"- Blow up the jail or bank to get XP.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Weapon Dealer "CHAT_WHITE"- Sell guns to player to get money and XP.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Weed Dealer "CHAT_WHITE"- Sell weeds to player to get money and XP.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Kidnapper "CHAT_WHITE"Kidnap players to get ransom and XP.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Hitman "CHAT_WHITE"- Kill and complete hit contract to get XP and money.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Trucker "CHAT_WHITE"- Complete truck mission to get XP and Money.", msg);
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "Job Selection", msg, "Choose", "");
}
else
{
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Mechanic "CHAT_WHITE"- Perbaiki kendaraan orang lain untuk mendapatkan XP dan uang.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Rapist "CHAT_WHITE" - Perkosa player lain dan infeksi dia dengan HIV.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Terrorist "CHAT_WHITE"- Ledakkan penjara atau bank untuk mendapatkan XP.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Weapon Dealer "CHAT_WHITE"- Jual senjata ke player lain untuk mendpatkan XP dan uang.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Weed Dealer "CHAT_WHITE"- Jual ganja ke player lain untuk mendpatkan XP dan uang.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Kidnapper "CHAT_WHITE"Culik player lain dan minta tebusan.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Hitman "CHAT_WHITE"- Bunuh dan selesaikan kontrak untuk mendapatkan XP dan uang.\n", msg);
format(msg, sizeof(msg), "%s"CHAT_YELLOW"Trucker "CHAT_WHITE"- Selesaikan misi untuk mendapatkan XP dan uang.", msg);
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "Pilih Pekerjaan", msg, "Pilih", "");
}
}
loadIcon(playerid);
if(Player[playerid][jailTime] == 0)
{
SetPlayerHealth(playerid, INF_FLOAT);
setPos(playerid);
Player[playerid][spawnLabel] = Create3DTextLabel("ANTI SPAWNKILL", COLOR_RED, 0.0, 0.0, 1.0, 100.0, 0, 1);
Attach3DTextLabelToPlayer(Player[playerid][spawnLabel], playerid, 0.0, 0.0, 0.4);
}
Player[playerid][playerLoad] = false;
SetTimerEx("spawnPlayer", 5500, false, "d", playerid);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
Player[playerid][onFallout] = false;
for(new x = 0; x < MAX_OSLOTS; x++)
{
if(Player[playerid][toyStatus][x])
{
if(IsPlayerAttachedObjectSlotUsed(playerid, x))
{
RemovePlayerAttachedObject(playerid, x);
}
}
}
removePlayerRoadblocks(playerid);
if(Player[playerid][usingAnim])
{
showTextdraw(playerid);
TextDrawHideForPlayer(playerid, GM[animTD]);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
Player[playerid][usingAnim] = false;
}
if(Player[playerid][onDM])
{
new dmmessage[126];
format(dmmessage, sizeof(dmmessage), CHAT_INFO"[DEATHMATCH]"CHAT_WHITE" %s has fallen.", GetName(playerid));
foreach(new i : Player)
{
if(Player[i][onDM])
SendClientMessage(i, COLOR_WHITE, dmmessage);
}
Player[playerid][onDM] = false;
}
if(Player[playerid][onDerby])
{
new dermsg[126];
format(dermsg, sizeof(dermsg), "%s has been eliminated from the event.", GetName(playerid));
foreach(new i : Player)
{
if(Player[i][onDerby])
Info(i, dermsg);
}
Player[playerid][onDerby] = false;
}
Delete3DTextLabel(Player[playerid][kidnapLabel]);
Delete3DTextLabel(Player[playerid][playerLabel]);
Delete3DTextLabel(Player[playerid][spawnLabel]);
Delete3DTextLabel(Player[playerid][titleLabel]);
Player[playerid][isTied] = false;
Player[playerid][hasRaped] = false;
Player[playerid][playerLoad] = false;
Player[playerid][weaponSell] = INVALID_PLAYER_ID;
if(Player[playerid][truckingMission])
{
Server(playerid, "Trucking mission failed.");
Player[playerid][truckID] = -1;
Player[playerid][truckingMission] = false;
Player[playerid][truckLoaded] = false;
RemovePlayerMapIcon(playerid, 69);
}
if(Player[playerid][onHIV])
{
Player[playerid][onHIV] = false;
KillTimer(Player[playerid][rapedTimer]);
}
if(Player[playerid][attackLeft] > 0)
{
new msg[1000], gID = findGang(playerid), z = Player[playerid][attackZone];
Player[playerid][attackZone] = -1;
format(msg, sizeof(msg), CHAT_GANG"[GANG-ZONE] "CHAT_WHITE"%s failed to capture %s and gangzone will be locked for 15 minutes.", GetName(playerid), GetXY2DZone(GZone[z][gzoneCPPos][0], GZone[z][gzoneCPPos][1]));
SendClientMessageToAll(COLOR_WHITE, msg);
KillTimer(Player[playerid][attackTimer]);
PlayerTextDrawHide(playerid, Player[playerid][gangzoneTD][1]);
PlayerTextDrawHide(playerid, Player[playerid][gangzoneTD][0]);
GZone[z][gzoneAttack] = false;
GZone[z][gzoneLocked] = true;
GZone[z][gzoneTime] = 900;
Gang[gID][gangAttack] = false;
GangZoneStopFlashForAll(GZone[z][gZone]);
Player[playerid][onAttack] = false;
Player[playerid][attackLeft] = 0;
}
if(Player[playerid][cuffed])
{
SetPlayerCuffed(playerid, false);
Player[playerid][cuffed] = false;
}
if(Player[playerid][onDuty])
{
removeDuty(playerid);
}
if(GetPVarInt(playerid, "YEAH") == 1)
{
DestroyObject(GPSObject[playerid]);
SetPVarInt(playerid, "YEAH",0);
DeletePVar(playerid, "Spongebob");
DeletePVar(playerid, "Mario");
DeletePVar(playerid, "SpiderPig");
DeletePVar(playerid, "FAIL");
}

SetPVarInt(playerid, "roped", 0);

if(Player[playerid][checkpointRobs] != -1)
forceendRobbery(playerid);

if(GetPVarInt(playerid,"roped") == 1)
{
for(new i = 0; i <= ROPELENGTH; i++)
{
DestroyObject(Player[playerid][rope][i]);
}
DisablePlayerCheckpoint(playerid);
}
Player[playerid][playerDeaths]++;

if(Player[playerid][isCaged])
Player[playerid][isCaged] = false;

Player[playerid][carVCP] = INVALID_VEHICLE_ID;
if(isConnected(killerid))
{
new msg5[512];
format(msg5, sizeof(msg5), "You just killed "CHAT_YELLOW"%s", GetName(playerid));
Server(killerid, msg5);
if(Player[playerid][hitValue] > 0 && Player[killerid][playerJob] == JOB_HITMAN)
{
giveMoney(killerid, Player[playerid][hitValue]);
format(msg5, sizeof(msg5), CHAT_YELLOW"%s"CHAT_WHITE" has completed the contract on "CHAT_YELLOW"%s"CHAT_WHITE" and earnt"CHAT_YELLOW"$%s", GetName(killerid), GetName(playerid), FormatNumber(Player[playerid][hitValue]));
foreach(new i : Player)
{
Server(i, msg5);
}
Player[playerid][hitValue] = 0;
}
Player[killerid][playerKills]++;
giveScore(killerid, 1);
giveXP(killerid, 5);
if(Player[killerid][playerClass] == CIVILIAN)
{
new bonus = 100;
if(inGang(killerid))
{
new ggID = findGang(killerid);
Gang[ggID][gangScore]++;
Gang[ggID][gangKills]++;
}
if(inGang(playerid))
{
new ggID = findGang(playerid);
Gang[ggID][gangDeaths]++;
}
giveWanted(killerid, 9);
switch(Player[playerid][playerTitle])
{
case 1:
bonus = bonus + 100;
case 2:
bonus = bonus + 300;
case 3:
bonus = bonus + 500;
case 4:
bonus = bonus + 1000;
}
giveMoney(killerid, bonus);
}

if(isLEO(killerid))
{
if(Player[playerid][playerWanted] > 0)
{
new wantedmsg[512], total = Player[playerid][playerWanted] * 120;
format(wantedmsg, sizeof(wantedmsg), "You've killed "CHAT_YELLOW"%s"CHAT_WHITE" with "CHAT_YELLOW"%d"CHAT_WHITE" wanted level, and received "CHAT_YELLOW"$%s.", GetName(playerid), Player[playerid][playerWanted], FormatNumber(total));
Server(killerid, wantedmsg);
giveMoney(killerid, total);
}
else
{
Player[killerid][killInnocent]++;
if(Player[killerid][killInnocent] >= 3)
{
ForceClassSelection(killerid);
Player[killerid][bannedClass] = true;
Server(killerid, "You have been banned from LEO classes, you can make appeal on www.ccnr.ml.");
}
else
{
new msg[1000];
format(msg, sizeof(msg), "You have been fined $5,000 for killing innocent civilian. (%d Warning(s))", Player[killerid][killInnocent]);
Server(killerid, msg);
SetPlayerHealth(killerid, 0);
SetPlayerCameraPos(killerid, -1649.0369, 625.2410, 58.9118);
SetPlayerCameraLookAt(killerid, -1648.4829, 626.0721, 58.4068);
format(msg, sizeof(msg), "%s{98B0CD}LEO Classes \n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}Playing as a law enforcement officer on this server is similar to other CNR game modes.\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}For those who aren't familiar with the commands, please see /commands after this tutorial\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}has concluded. This tutorial will act as a simple guide on how to act whilst playing as a cop.\n\n", msg);
format(msg, sizeof(msg), "%s{98B0CD}LEO Classes Rules\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}- Don't shoot your team vehicles.\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}- Don't attack your teammates.\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}- Teaming with criminals are not allowed.\n", msg);
format(msg, sizeof(msg), "%s{FFFFFF}- Money Farming are not allowed.\n", msg);
ShowPlayerDialog(killerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "LEO Classes information", msg, "Close", "");
SetTimerEx("stopCamera", 10000, false, "d", playerid);
}
takeMoney(killerid, 5000);
}
}

switch(Player[killerid][playerKills])
{
case 1:
{
if(Player[killerid][english])
showAchievements(killerid, "Great, it's your first kill", 5000);
else
showAchievements(killerid, "Hebat, kamu membunuh lawan pertamamu", 5000);
}
case 100:
{
if(Player[killerid][english])
showAchievements(killerid, "You've killed 100 players, Nice!", 20000);
else
showAchievements(killerid, "Kamu telah membunuh 100 player, Hebat!", 20000);
}
case 500:
{
if(Player[killerid][english])
showAchievements(killerid, "Unbelievable, it's your 500 kills", 25000);
else
showAchievements(killerid, "Tidak dapat dipercaya, kamu telah membunuh 500 player", 20000);
}
case 1000:
{
if(Player[killerid][english])
showAchievements(killerid, "San Fierro Killer", 50000);
else
showAchievements(killerid, "Kamu adalah pembunuh di San Fierro", 20000);
}
}
}
setWanted(playerid, 0);
Player[playerid][isSpawned] = false;
Player[playerid][islockerShow] = false;
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
new bool:found = false;
if(GetVehicleModel(vehicleid) == 548)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i, "chop_id") == vehicleid && GetPVarInt(i, "roped") == 1)
{
DisablePlayerCheckpoint(i);
SetPVarInt(i, "roped", 0);
DisablePlayerCheckpoint(i);
ClearAnimations(i);
TogglePlayerControllable(i, 1);
for(new z = 0;z <= ROPELENGTH; z++)
{
DestroyObject(Player[i][rope][z]);
}
}
}
}
}
for(new i = 0; i < MAX_VEH; i++)
{
if(Vehicles[i][vehicleData] == vehicleid)
{
createVehicle(i, true);
found = true;
break;
}
}
if(found)
{
return 0;
}
return 1;
}

public OnPlayerText(playerid, text[])
{
if(!Player[playerid][loggedIn])
return 0;

if(IsIp(text))
{
if(Player[playerid][english])
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Advert detected", "Advert Detected, you can use another place to advertise your server.", "Okay", "");
else
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Advert terdeteksi", "Advertising terdeteksi, kamu bisa advertising di semua tempat tetapi tidak di server ini.", "Okay", "");
return 0;
}

if(gettime() < Player[playerid][muteTime])
{
if(Player[playerid][english])
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "You have been muted", "You have been muted, Please wait before sending message.", "Okay", "");
else
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Kamu di mute", "Kamu telah di mute, anda tidak bisa berbicara.", "Okay", "");
return 0;
}

for(new i = 0; i < MAX_ENTRY; i++) {
if(!Swear[i][0]) continue;
Censored(text,Swear[i]);
}

new time = GetTickCount() - Player[playerid][textTimer];
if(time < 1500)
{
if(Player[playerid][english])
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Anti Spam", "Please wait before send another message.", "Okay", "");
else
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Anti Spam", "Mohon tunggu sebelum mengirim pesan lagi.", "Okay", "");
return 0;
}

#if defined USE_SOCKET
if(GM[allowSocket])
{
format(gQuery, sizeof(gQuery), "msg:%d:%s:%s", playerid, GetName(playerid), text);
sendToClients(gQuery);
}
#endif
Player[playerid][textTimer] = GetTickCount();

if(text[0] == '@' && Player[playerid][playerLevel] > 0)
{
adminChat(playerid, text[1]);
return 0;
}

if(text[0] == '!' && Player[playerid][playerLevel] > 4)
{
bawsChat(playerid, text[1]);
return 0;
}

if(text[0] == '^' && inGang(playerid))
{
SGC(playerid, text[1]);
return 0;
}

new msg[256];
if(inGang(playerid))
{
new gID;
gID = findGang(playerid);
format(msg, sizeof(msg), "[%s]%s(%d) : "CHAT_WHITE"%s", Gang[gID][gangTag], GetName(playerid), playerid, text);
}
else
{
format(msg, sizeof(msg), "%s(%d) : "CHAT_WHITE"%s", GetName(playerid), playerid, text);
}
SendClientMessageToAll(GetPlayerColor(playerid), msg);
return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 548 && ispassenger)
{
SetPVarInt(playerid, "chop_id", GetPlayerVehicleID(playerid));
SetPVarInt(playerid, "roped", 0);
}
else SetPVarInt(playerid, "chop_id", 0);
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
if(Player[playerid][onDerby])
{
if(Player[playerid][onDerby])
{
new msg[256];
format(msg, sizeof(msg), "%s has been eliminated from the event.", GetName(playerid));
foreach(new i : Player)
{
if(Player[i][onDerby])
Info(i, msg);
}
loadData(playerid);
Player[playerid][onDerby] = false;
}
}
if(Player[playerid][truckingMission])
{
Server(playerid, "Trucking mission failed.");
Player[playerid][truckID] = -1;
Player[playerid][truckingMission] = false;
Player[playerid][truckLoaded] = false;
RemovePlayerMapIcon(playerid, 69);
}
disableGPS(playerid);
if(GetVehicleModel(vehicleid) == 497)
{
if(IsValidDynamicObject(gunnerPlace[vehicleid][0]))
{
DestroyDynamicObject(gunnerPlace[vehicleid][0]);
DestroyDynamicObject(gunnerPlace[vehicleid][1]);
}
}
Player[playerid][lastCar] = vehicleid;
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
disableGPS(playerid);
if(newstate == PLAYER_STATE_ENTER_VEHICLE_PASSENGER)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 548)
{
if(Player[playerid][english])
Server(playerid, "Use "CHAT_YELLOW"Key Submission"CHAT_WHITE" or"CHAT_YELLOW" 2"CHAT_WHITE" to slide from this vehicle.");
else
Server(playerid, "Gunakan "CHAT_YELLOW"Key Submission"CHAT_WHITE" atau tekan"CHAT_YELLOW" 2"CHAT_WHITE" untuk turun dari kendaraan.");
}
}
}
else if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid), bool:found = false;
if(Player[playerid][showGT])
{
new msg[30];
format(msg, sizeof(msg), "~w~%s", vehicleNames[GetVehicleModel(vehicleid) - 400]);
GameTextForPlayer(playerid, msg, 3, 1);
}
// if(GetVehicleModel(vehicleid) == 497)
// {
// gunnerPlace[vehicleid][0] = CreateDynamicObject(19302, 0, 0, 0, 0, 0, 0);
// gunnerPlace[vehicleid][1] = CreateDynamicObject(19302, 0, 0, 0, 0, 0, 0);
// SetDynamicObjectMaterial(gunnerPlace[vehicleid][0], 0, 0, "none", "none");
// SetDynamicObjectMaterial(gunnerPlace[vehicleid][1], 0, 0, "none", "none");
// SetTimerEx("attachGunner", 1500, false, "d", vehicleid);
// }
if(Player[playerid][playerJob] == JOB_TRUCKER && (GetVehicleModel(vehicleid) == 414 || GetVehicleModel(vehicleid) == 456 || GetVehicleModel(vehicleid) == 498 || GetVehicleModel(vehicleid) == 499))
{
Server(playerid, "Press "CHAT_YELLOW"2"CHAT_WHITE" to start trucking mission.");
}
if(Player[playerid][useSpeedo])
{
if(!IsBicycle(vehicleid))
{
Player[playerid][timerSpeed] = SetTimerEx("speedoTimer", 200, true, "d", playerid);
showSpeedo(playerid);
}
}
for(new i = 0; i < MAX_VEH; i++)
{
if(Vehicles[i][vehicleData] == vehicleid)
{
found = true;
checkVehicle(playerid, i);
break;
}
}

if(!found && Player[playerid][playerClass] != SPY)
{
switch(GetVehicleModel(vehicleid))
{
case 416:
{
if(Player[playerid][playerClass] != MEDIC)
{
Info(playerid, "This vehicle only for medic class.");
RemovePlayerFromVehicle(playerid);
}
}
case 427, 390, 497, 523, 560, 597, 599:
{
if(!isLEO(playerid))
{
if(Player[playerid][playerWanted] <= 6)
{
Info(playerid, "You tried to steal an LEO vehicle and received {E6BD1A}6 {FFFFFF}wanted!");
giveWanted(playerid, 6);
}
}
}
case 433, 447, 470, 520, 548:
{
if(Player[playerid][playerClass] != ARMY)
{
if(Player[playerid][playerWanted] <= 6 && Player[playerid][playerClass] == CIVILIAN)
{
Info(playerid, "You tried to steal an LEO vehicle and received {E6BD1A}6 {FFFFFF}wanted!");
giveWanted(playerid, 6);
}
RemovePlayerFromVehicle(playerid);
}
}
}
}
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
if(Player[playerid][useSpeedo])
{
hideSpeedo(playerid);
KillTimer(Player[playerid][timerSpeed]);
}
}

if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerArmedWeapon(playerid, 0);
}
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid,"roped") == 1 && Player[playerid][playerClass] == ARMY)
{
SetPVarInt(playerid, "roped", 0);
SetPVarInt(playerid, "chop_id", 0);
ClearAnimations(playerid);
TogglePlayerControllable(playerid, 0);
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
for(new i = 0; i <= ROPELENGTH; i++)
{
DestroyObject(Player[playerid][rope][i]);
}
}
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
new class = Player[playerid][playerClass];
if(!Player[playerid][loggedIn])
return 0;

switch(class)
{
case POLICE:
{
if(Player[playerid][bannedClass])
{
if(Player[playerid][english])
Server(playerid, "You are banned from LEO this class.");
else
Server(playerid, "Kamu telah dibanned dari LEO class.");
return 0;
}
if(Player[playerid][playerXP] < 500)
{
if(Player[playerid][english])
Server(playerid, "You must have 500 XP to choose this class.");
else
Server(playerid, "Kamu harus punya 500 XP untuk memilih team ini.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
case FBI:
{
if(Player[playerid][bannedClass])
{
if(Player[playerid][english])
Server(playerid, "You are banned from LEO this class.");
else
Server(playerid, "Kamu telah dibanned dari LEO class.");
return 0;
}
if(Player[playerid][playerXP] < 20000)
{
if(Player[playerid][english])
Server(playerid, "You must have 20000 XP to choose this class.");
else
Server(playerid, "Kamu harus punya 20000 XP untuk memilih team ini.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
case CIA:
{
if(Player[playerid][bannedClass])
{
if(Player[playerid][english])
Server(playerid, "You are banned from LEO this class.");
else
Server(playerid, "Kamu telah dibanned dari LEO class.");
return 0;
}
if(Player[playerid][playerXP] < 30000)
{
if(Player[playerid][english])
Server(playerid, "You must have 30000 XP to choose this class.");
else
Server(playerid, "Kamu harus punya 30000 XP untuk memilih team ini.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
case ARMY:
{
if(Player[playerid][bannedClass])
{
if(Player[playerid][english])
Server(playerid, "You are banned from LEO this class.");
else
Server(playerid, "Kamu telah dibanned dari LEO class.");
return 0;
}
if(Player[playerid][playerXP] < 40000)
{
if(Player[playerid][english])
Server(playerid, "You must have 40000 XP to choose this class.");
else
Server(playerid, "Kamu harus punya 40000 XP untuk memilih team ini.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
case SPY:
{
if(Player[playerid][bannedClass])
{
if(Player[playerid][english])
Server(playerid, "You are banned from LEO this class.");
else
Server(playerid, "Kamu telah dibanned dari LEO class.");
return 0;
}
if(Player[playerid][vipLevel] < 1)
{
if(Player[playerid][english])
Server(playerid, "You must be a VIP member to choose this class.");
else
Server(playerid, "Kamu harus menjadi VIP untuk memilih team ini.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
case MEDIC:
{
if(Player[playerid][playerXP] < 200)
{
Server(playerid, "You must have 200 XP to choose this class.");
return 0;
}
if(Player[playerid][playerWanted] > 0)
{
if(Player[playerid][english])
Server(playerid, "You must be innocent to choose this class.");
else
Server(playerid, "Kamu mempunyai bintang, kamu tidak bisa memilih team ini.");
return 0;
}
}
}
TextDrawHideForPlayer(playerid, GM[classonTD][0]);
TextDrawHideForPlayer(playerid, GM[classonTD][1]);
TextDrawHideForPlayer(playerid, GM[classonTD][2]);
TextDrawHideForPlayer(playerid, GM[classonTD][3]);
TextDrawHideForPlayer(playerid, GM[classonTD][4]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][0]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][1]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][2]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][3]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][4]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][5]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][6]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][7]);
PlayerTextDrawHide(playerid, Player[playerid][classSelectTD][8]);
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(newinteriorid == 182)
{
if(Player[playerid][english])
Server(playerid, "Type /shop to buy an items!");
else
Server(playerid, "Ketik /shop untuk membeli item!");
}
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(Player[playerid][playerClass] == ARMY && GetPVarInt(playerid, "roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_SUBMISSION || newkeys == KEY_SUBMISSION))
{
if(inTied(playerid))
{
return 1;
}
GetPlayerPos(playerid, Player[playerid][ropePos][0], Player[playerid][ropePos][1], Player[playerid][ropePos][2]);
MapAndreas_FindZ_For2DCoord(Player[playerid][ropePos][0], Player[playerid][ropePos][1], Player[playerid][ropePos][3]);
Player[playerid][ropePos][4] = floatsub(Player[playerid][ropePos][2], Player[playerid][ropePos][3]);
if(Player[playerid][ropePos][4] >= ROPELENGTH)
{
if(Player[playerid][english])
return Server(playerid, "You will die if you slide from this height.");
else
return Server(playerid, "Kamu akan mati jika turun dari ketinggian ini.");
}
if(Player[playerid][ropePos][4] <= 2) return RemovePlayerFromVehicle(playerid);
SetPVarInt(playerid, "roped", 1);
SetPlayerCheckpoint(playerid, Player[playerid][ropePos][0], Player[playerid][ropePos][1], floatsub(Player[playerid][ropePos][3], OFFSET), 20);
SetPlayerPos(playerid, Player[playerid][ropePos][0], Player[playerid][ropePos][1], floatsub(Player[playerid][ropePos][2],2));
SetPlayerVelocity(playerid, 0, 0, 0);
for(new i = 0; i != i; i++) ApplyAnimation(playerid, "ped", "abseil", 4.0, 0, 0, 0, 1, 0);
for(new z = 0; z <= Player[playerid][ropePos][4]; z++)
{
Player[playerid][rope][z] = CreateObject(3004, Player[playerid][ropePos][0], Player[playerid][ropePos][1], floatadd(Player[playerid][ropePos][3], z), 87.640026855469, 342.13500976563, 350.07507324219);
}
SetTimerEx("syncAnim", DURATION, 0, "i", playerid);
}

if((newkeys & KEY_WALK) && !(oldkeys & KEY_WALK))
{
if(IsPlayerInCheckpoint(playerid))
{
for(new i = 0; i < MAX_ROB_CP; i++)
{
if(IsPlayerInDynamicCP(playerid, robData[i][robCP]))
{
beginRobbery(playerid, i);
break;
}
}
}
}

if(((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) || ((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)))
{
if(Player[playerid][usingAnim])
{
TextDrawHideForPlayer(playerid, GM[animTD]);
showTextdraw(playerid);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
Player[playerid][usingAnim] = false;
}
}

if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(isCuffed(playerid) || inTied(playerid))
{
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(Player[playerid][playerJob] == JOB_TRUCKER && (GetVehicleModel(vehicleid) == 414 || GetVehicleModel(vehicleid) == 456 || GetVehicleModel(vehicleid) == 498 || GetVehicleModel(vehicleid) == 499))
{
if(Player[playerid][truckingMission])
{
return 1;
}
else
{
Player[playerid][truckingMission] = true;
new z = random(MAX_TRUCKING), msg[512];
format(msg, sizeof(msg), "Pickup "CHAT_YELLOW"%s"CHAT_WHITE" from "CHAT_YELLOW"%s"CHAT_WHITE".", Truck[z][missionPickup], Truck[z][truckLocation]);
Server(playerid, msg);
disableGPS(playerid);
Player[playerid][truckID] = z;
setGPS(playerid, Truck[z][truckXYZ][0], Truck[z][truckXYZ][1], Truck[z][truckXYZ][2]);
Server(playerid, "Follow the arrow to pickup cargo.");
SetPlayerMapIcon(playerid, 69, Truck[z][truckXYZ][0], Truck[z][truckXYZ][1], Truck[z][truckXYZ][2], 51, 0, MAPICON_GLOBAL);
SetPlayerRaceCheckpoint(playerid, 3, Truck[z][truckXYZ][0], Truck[z][truckXYZ][1], Truck[z][truckXYZ][2], 0.00, 0.00, 0.00, 5.0);
}
}
}
}

if((newkeys & KEY_NO) && !(oldkeys & KEY_NO))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(isCuffed(playerid) || inTied(playerid))
{
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(Player[playerid][playerJob] == JOB_TRUCKER && (GetVehicleModel(vehicleid) == 414 || GetVehicleModel(vehicleid) == 456 || GetVehicleModel(vehicleid) == 498 || GetVehicleModel(vehicleid) == 499))
{
new z = Player[playerid][truckID];
if(!Player[playerid][truckingMission])
{
return 1;
}
else
{
if(Player[playerid][truckLoaded])
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, Truck[z][truckEndXYZ][0], Truck[z][truckEndXYZ][1], Truck[z][truckEndXYZ][2]))
{
return 1;
}
new msg[1500], moneyRand = randomex(Truck[z][missionLowest], Truck[z][missionCount]);
format(msg, sizeof(msg), CHAT_SERVER"[SERVER]"CHAT_YELLOW" %s "CHAT_WHITE"delivered %s to %s and earnt "CHAT_YELLOW"%s.", GetName(playerid), Truck[z][missionPickup], Truck[z][truckEnd], FormatNumber(moneyRand));
SendClientMessageToAll(COLOR_WHITE, msg);
loadCargo(playerid);
giveMoney(playerid, moneyRand);
giveScore(playerid, 5);
Server(playerid, "Unloading cargo, please wait.");
disableGPS(playerid);
Player[playerid][truckLoaded] = false;
Player[playerid][truckID] = -1;
RemovePlayerMapIcon(playerid, 69);
DisablePlayerRaceCheckpoint(playerid);
}
else
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, Truck[z][truckXYZ][0], Truck[z][truckXYZ][1], Truck[z][truckXYZ][2]))
{
return 1;
}
loadCargo(playerid);
new msg[512];
format(msg, sizeof(msg), "Deliver "CHAT_YELLOW"%s to "CHAT_YELLOW"%s", Truck[z][missionPickup], Truck[z][truckEnd]);
Server(playerid, msg);
Server(playerid, "Follow the arrow to complete trucking mission.");
Server(playerid, "Loading cargo, please wait.");
disableGPS(playerid);
Player[playerid][truckLoaded] = true;
setGPS(playerid, Truck[z][truckEndXYZ][0], Truck[z][truckEndXYZ][1], Truck[z][truckEndXYZ][2]);
RemovePlayerMapIcon(playerid, 69);
SetPlayerMapIcon(playerid, 69, Truck[z][truckEndXYZ][0], Truck[z][truckEndXYZ][1], Truck[z][truckEndXYZ][2], 51, 0, MAPICON_GLOBAL);
SetPlayerRaceCheckpoint(playerid, 3, Truck[z][truckEndXYZ][0], Truck[z][truckEndXYZ][1], Truck[z][truckEndXYZ][2], 0.00, 0.00, 0.00, 5.00);
}
}
}
}
}

if((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
{
if(IsPlayerInCheckpoint(playerid) && Player[playerid][checkpointRobs] != -1)
{
for(new i = 0; i < MAX_ROB_CP; i++)
{
if(IsPlayerInDynamicCP(playerid, robData[i][robCP]))
{
forceendRobbery(playerid);
break;
}
}
}
}

if((newkeys & KEY_CTRL_BACK) && !(oldkeys & KEY_CTRL_BACK))
{
if(Player[playerid][playerJob] == JOB_TERRORIST)
{
detonateExplosive(playerid);
}
}

if((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
{
if(isCuffed(playerid) || inTied(playerid))
{
return 1;
}
new bool:found = false;
if(IsPlayerInCheckpoint(playerid))
{
new tick = GetTickCount() - Player[playerid][enteredCP];
if(tick < 10000)
{
return 1;
}
for(new i = 0; i < MAX_HOUSE; i++)
{
if(IsPlayerInDynamicCP(playerid, House[i][houseCP]))
{
if(House[i][houseOwner] == Player[playerid][pID] && House[i][houseOwned])
{
new int = findInt(i);
Player[playerid][lastHouse] = i;
SetPlayerInterior(playerid, HouseInt[int][houseintID]);
SetPlayerVirtualWorld(playerid, i);
SetPlayerPos(playerid, HouseInt[int][intPos][0], HouseInt[int][intPos][1], HouseInt[int][intPos][2]);
SetPlayerFacingAngle(playerid, HouseInt[int][intPos][3]);
Player[playerid][enteredCP] = GetTickCount();
loadWorld(playerid);
found = true;
if(Player[playerid][english])
Server(playerid, "Welcome to your house, type /hcp to view house control panel.");
else
Server(playerid, "Selamat datang di rumahmu, ketikkan /hcp untuk melihat control panel rumahmu.");
}
else
{
if(!strcmp(House[i][housePassword], "none"))
{
new int = findInt(i);
Player[playerid][lastHouse] = i;
SetPlayerInterior(playerid, HouseInt[int][houseintID]);
SetPlayerVirtualWorld(playerid, i);
SetPlayerPos(playerid, HouseInt[int][intPos][0], HouseInt[int][intPos][1], HouseInt[int][intPos][2]);
SetPlayerFacingAngle(playerid, HouseInt[int][intPos][3]);
Player[playerid][enteredCP] = GetTickCount();
loadWorld(playerid);
found = true;
}
else
{
Player[playerid][lastHouse] = i;
if(Player[playerid][english])
ShowPlayerDialog(playerid, DIALOG_HOUSEPASS, DIALOG_STYLE_INPUT, "Please Enter Password", "Please enter house password below :", "Enter", "Close");
else
ShowPlayerDialog(playerid, DIALOG_HOUSEPASS, DIALOG_STYLE_INPUT, "Masukkan Password", "Masukkan password rumah dibawah :", "Masuk", "Tutup");
}
}
break;
}
}

for(new i = 0; i < MAX_GARAGE; i++)
{
if(found) break;

if(IsPlayerInDynamicCP(playerid, Garage[i][garageCP]))
{
found = true;

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(Garage[i][garageOwner] != Player[playerid][pID])
{
if(Garage[i][garageOwner] == -1 || Garage[i][garageLock])
{
if(Player[playerid][english])
Server(playerid, "This garage is locked.");
else
Server(playerid, "Garasi ini terkunci.");
return 1;
}
}

if(IsPlayerInAnyVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 3);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), i);
foreach(new z : Player)
{
if(IsPlayerInAnyVehicle(z))
{
if(z == playerid) continue;
if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(z))
{
Player[z][lastGarage] = i;
SetPlayerInterior(z, 3);
SetPlayerVirtualWorld(z, i);
Player[z][enteredCP] = GetTickCount();
loadWorld(z);
}
}
}
Player[playerid][lastGarage] = i;
Player[playerid][enteredCP] = GetTickCount();
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, i);
SetVehiclePos(GetPlayerVehicleID(playerid), 1341.6104,-1548.3873,10038.3174);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 181.0607);
loadWorld(playerid);
}
}
else
{
Player[playerid][lastGarage] = i;
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, i);
SetPlayerPos(playerid, 1341.6180,-1545.7734,10037.3174);
SetPlayerFacingAngle(playerid, 174.8018);
loadWorld(playerid);
}
}
}

for(new i = 0; i < MAX_HOUSE_INT; i++)
{
if(found) break;

if(IsPlayerInDynamicCP(playerid, HouseInt[i][intCP]))
{
new int = Player[playerid][lastHouse];
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, House[int][housePos][0], House[int][housePos][1], House[int][housePos][2]);
SetPlayerFacingAngle(playerid, House[int][housePos][3]);
Player[playerid][enteredCP] = GetTickCount();
Player[playerid][lastHouse] = -1;
loadWorld(playerid);
found = true;
break;
}
}
}
}
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
if(!Player[playerid][onDuty])
updateWanted(playerid);

if(Player[playerid][onDerby])
{
new Float:x, Float:y, Float:z, msg[256];
format(msg, sizeof(msg), "%s is falled from the map.", GetName(playerid));
GetPlayerPos(playerid, x, y, z);
if(z < -1.00)
{
foreach(new i : Player)
{
if(Player[i][onDerby])
Info(i, msg);
}
loadData(playerid);
Player[playerid][onDerby] = false;
}
}

if(Player[playerid][onFallout])
{
new Float:x, Float:y, Float:z, msg[512];
format(msg, sizeof(msg), "%s has dropped out of Fallout event.", GetName(playerid));
GetPlayerPos(playerid, x, y, z);
if(z < 2.00)
{
foreach(new i : Player)
{
if(Player[i][onFallout])
Info(i, msg);
}
loadData(playerid);
SetCameraBehindPlayer(playerid);
Player[playerid][onFallout] = false;
}
}
if(GetPVarInt(playerid,"YEAH") == 1)
{
new
Float:VPos[3],
Float:Rotation
;

GetVehiclePos(GetPlayerVehicleID(playerid), VPos[0], VPos[1], VPos[2]);
Rotation = PointAngle(playerid, VPos[0], VPos[1], GetPVarFloat(playerid, "Spongebob"), GetPVarFloat(playerid, "Mario"));
if(!Player[playerid][truckingMission])
AttachObjectToVehicle(GPSObject[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 1.5, 0.0, 90.0, Rotation);
else
AttachObjectToVehicle(GPSObject[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 3.5, 0.0, 90.0, Rotation);
}
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new msg[12];
format(msg, sizeof(msg), "%d", clickedplayerid);
cmd_stats(playerid, msg);
return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(Player[playerid][playerLevel] > 5)
{
return 1;
}
if(Player[playerid][isSpawned])
{
if(Player[playerid][onDerby] || Player[playerid][onDM])
{
if(Player[playerid][english])
Server(playerid, "You can't use any commands while in event.");
else
Server(playerid, "Kamu tidak bisa memasukkan perintah ketika sedang di event.");
return 0;
}

if(Player[playerid][playerLoad])
{
if(Player[playerid][english])
Server(playerid, "You can't use this command while loading object.");
else
Server(playerid, "Kamu tidak bisa memasukkan perintah ini ketika sedang loading.");
return 0;
}

if(isTazed(playerid))
{
if(Player[playerid][english])
Server(playerid, "You can't use this command while tazed.");
else
Server(playerid, "Kamu tidak bisa memasukkan perintah apapun ketika tersetrum.");
return 0;
}

if(Player[playerid][useCommand])
{
return 1;
}
else
{
if(Player[playerid][english])
Server(playerid, "Please wait to use another commands.");
else
Server(playerid, "Mohon tunggu sebelum memasukkan perintah lain.");
return 0;
}
}
else
{
if(Player[playerid][english])
Server(playerid, "You can't use any commands while you're not fully spawned.");
else
Server(playerid, "Kamu harus spawn sebelum memasukkan perintah.");
return 0;
}
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if (!success)
{
if(Player[playerid][english])
return Server(playerid, "Unknown command, type "CHAT_YELLOW"/cmds "CHAT_WHITE"to view command list.");
else
return Server(playerid, "Perintah tidak ditemukan, ketik "CHAT_YELLOW"/cmds "CHAT_WHITE"untuk melihat daftar perintah.");
}
new msg[56];
Player[playerid][useCommand] = false;
SetTimerEx("antiSpam", 1000, false, "d", playerid);
format(msg, sizeof(msg), "%s : %s", GetName(playerid), cmdtext);
Log("commandLog.html", msg);
return 1;
}

public OnPlayerPause(playerid)
{
if(Player[playerid][isSpawned])
{
if(Player[playerid][english])
Server(playerid, "You're Away From Keyboard (AFK).");
else
Server(playerid, "Kamu telah AFK.");
}
if(inTied(playerid))
{
new report[512];
format(report, sizeof(report), CHAT_RED"%s AFK while tied.", GetName(playerid));
SRM(report);
}
if(isCuffed(playerid))
{
new report[512];
format(report, sizeof(report), CHAT_RED"%s AFK while cuffed.", GetName(playerid));
SRM(report);
}
Player[playerid][paused] = true;
return 1;
}

public OnPlayerUnpause(playerid)
{
if(Player[playerid][isSpawned])
{
new msg[56];
if(Player[playerid][english])
format(msg, sizeof(msg), "You have been AFK for "CHAT_YELLOW"%d"CHAT_WHITE" seconds.", gettime() - TimeSincePaused(playerid));
else
format(msg, sizeof(msg), "Kamu telah AFK selama "CHAT_YELLOW"%d"CHAT_WHITE" detik.", gettime() - TimeSincePaused(playerid));
Server(playerid, msg);
}
if(isCuffed(playerid) && (gettime() - TimeSincePaused(playerid)) > 15)
{
new msg2[512];
format(msg2, sizeof(msg2), "Avoid detected, "CHAT_YELLOW"%s"CHAT_WHITE" AFK for "CHAT_YELLOW"%s seconds"CHAT_YELLOW" while cuffed!", GetName(playerid), gettime() - TimeSincePaused(playerid));
SRM(msg2);
return 1;
}
Player[playerid][paused] = false;
return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(!Player[playerid][CoolDown] && Player[issuerid][aimbotToggle]) Player[issuerid][CoolDown] = true, SetTimerEx("ResetCoolDown", 2500, false, "i", issuerid);
}
return 1;
}

public OnPlayerFPSChange(playerid, oldfps, newfps)
{
if(Player[playerid][usedFPS])
{
new msg[5];
format(msg, sizeof(msg), "%d", newfps);
PlayerTextDrawSetString(playerid, Player[playerid][fpsplayerTD], msg);
PlayerTextDrawShow(playerid, Player[playerid][fpsplayerTD]);
}
return 1;
}

public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
{
EditDynamicObject(playerid, objectid);
return 1;
}

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
SetDynamicObjectPos(objectid, x, y, z);
SetDynamicObjectRot(objectid, rx, ry, rz);
return 1;
}

public OnPlayerUseVending(playerid)
{
//ClearAnimations(playerid);
return 1;
}

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if( hittype != BULLET_HIT_TYPE_NONE )
{
if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) )
{
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Bullet Crasher", CHAT_RED"Bullet crasher hack detected! \n"CHAT_WHITE"If this Anticheat wrongly detected, you can make a report in forums.", "Close", "");
KickDelay(playerid);
return 0;
}
}
if(hittype == BULLET_HIT_TYPE_PLAYER && !IsPlayerNPC(hitid) && GM[aimbotCheck])
{
if(!Player[hitid][paused] && !Player[playerid][CoolDown])
{
new surf = GetPlayerSurfingVehicleID(playerid), tsurf = GetPlayerSurfingVehicleID(hitid);
if(surf == INVALID_VEHICLE_ID && tsurf == INVALID_VEHICLE_ID && !IsPlayerInAnyVehicle(hitid))
{
new
Float:targetpkl = NetStats_PacketLossPercent(hitid),
Float:playerpkl = NetStats_PacketLossPercent(playerid)
;
if(targetpkl < 0.8 && playerpkl < 0.8)
{
new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
CheckForAimbot(playerid, fHitPosX, fHitPosY, fHitPosZ, hitid);
}
else printf("[AIMBOT] skipping '%s' and(or) '%s' due to packetloss being above 0.8", GetName(playerid), GetName(hitid));
}
else printf("[AIMBOT] skipping '%s' and(or) '%s' due to valid surf-vehicle/in-vehicle", GetName(playerid), GetName(hitid));
}
else printf("[AIMBOT] skipping '%s' and(or) '%s' due to target being afk/player having cooldown", GetName(playerid), GetName(hitid));
}
return 1;
}

public OnPlayerCheat(playerid, cheatid, source[])
{
new reason[128], msg[256];
if(Player[playerid][playerLoad] && cheatid == 6 || Player[playerid][paused])
{
return 0;
}
if(GM[derbyOpen] && cheatid == 6)
return 0;

switch(cheatid)
{
case 1: format(reason,sizeof(reason),"Money Hack $%s",source);
case 2: format(reason,sizeof(reason),"Weapon Hack \"%s\"",source);
case 3: format(reason,sizeof(reason),"Ammo Hack ( %s Bullets )",source);
case 4: format(reason,sizeof(reason),"Ammo Block Hack");
case 5: format(reason,sizeof(reason),"Speed Hack");
case 6: format(reason,sizeof(reason),"Airbreak/Teleport Hack");
case 7: format(reason,sizeof(reason),"Health Hack");
case 8: format(reason,sizeof(reason),"Armour Hack");
case 9: format(reason,sizeof(reason),"Vehicle Spawn Hack");
case 10: format(reason,sizeof(reason),"Vehicle Crasher");
}
if(cheatid == 3 || cheatid == 4 || cheatid == 2 || cheatid == 1)
{
return 0;
}

if(adminLevel(playerid, 6))
{
return 1;
}
if(Player[playerid][cheatDetected] > 50 && Player[playerid][isSpawned])
{
if(!Player[playerid][inBanned])
AC_ban(playerid, reason, 10080);
}
else
{
Player[playerid][cheatDetected]++;
format(msg, sizeof(msg), CHAT_YELLOW"%s"CHAT_WHITE" suspected for "CHAT_YELLOW"%s", GetName(playerid), reason);
SAM(msg);
}
return 1;
}

public OnPlayerFloodControl(playerid, iCount, iTimeSpan)
{
if(iCount > 3 && iTimeSpan < 5000)
{
new name[52];
GetPlayerIp(playerid, name, 52);
format(name, 52, "banip %s", name);
SendRconCommand(name);
AC_ban(playerid, "Flood Bot", 10080);
}
}

public OnPlayerShootPlayer(Shooter,Target,Float:HealthLos t,Float:ArmourLost)
{
new team = Player[Shooter][playerClass],
team2 = Player[Target][playerClass];

new Float:health;
GetPlayerHealth(Target, health);
if(team == CIVILIAN && (team2 == ARMY || team2 == POLICE || team2 == FBI || team2 == CIA || team2 == SPY))
{
if(Player[Shooter][playerWanted] < 9)
{
setWanted(Shooter, 9);
}
}

if((team == ARMY || team == POLICE || team == FBI || team == CIA || team == SPY) && team2 == CIVILIAN && Player[Target][playerWanted] == 0)
{
SetPlayerHealth(Target, floatadd(health, HealthLost));
GameTextForPlayer(Shooter, "Don't attack innocent civilian.", 1000, 5);
}
return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == GM[alogTD][11])
{
TextDrawHideForPlayer(playerid, GM[alogTD][0]);
TextDrawHideForPlayer(playerid, GM[alogTD][1]);
TextDrawHideForPlayer(playerid, GM[alogTD][2]);
TextDrawHideForPlayer(playerid, GM[alogTD][3]);
TextDrawHideForPlayer(playerid, GM[alogTD][4]);
TextDrawHideForPlayer(playerid, GM[alogTD][5]);
TextDrawHideForPlayer(playerid, GM[alogTD][6]);
TextDrawHideForPlayer(playerid, GM[alogTD][7]);
TextDrawHideForPlayer(playerid, GM[alogTD][8]);
TextDrawHideForPlayer(playerid, GM[alogTD][9]);
TextDrawHideForPlayer(playerid, GM[alogTD][10]);
TextDrawHideForPlayer(playerid, GM[alogTD][11]);
}
return 1;
}

public OnPlayerRequestGate(playerid, gateid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
for(new i = 0; i < MAX_VEH; i++)
{
if(Vehicles[i][vehicleData] == vehicleid)
{
Vehicles[i][vehMods][GetVehicleComponentType(componentid)] = componentid;
break;
}
}
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
for(new i = 0; i < MAX_VEH; i++)
{
if(Vehicles[i][vehicleData] == vehicleid)
{
Vehicles[i][vehPaint] = paintjobid;
break;
}
}
return 1;
}

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(IsPlayerAdmin(playerid))
{
MapAndreas_FindZ_For2DCoord(fX, fY, fZ);
SetPlayerPos(playerid, fX, fY, fZ + 2.0);
}
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(isCuffed(playerid))
{
return 1;
}

new vehicleid = GetPlayerVehicleID(playerid);
if(Player[playerid][playerJob] == JOB_TRUCKER && (GetVehicleModel(vehicleid) == 414 || GetVehicleModel(vehicleid) == 456 || GetVehicleModel(vehicleid) == 498 || GetVehicleModel(vehicleid) == 499))
{
if(Player[playerid][truckLoaded])
{
Server(playerid, "Press"CHAT_YELLOW" N"CHAT_WHITE" to unload cargo.");
}
else
{
Server(playerid, "Press"CHAT_YELLOW" N"CHAT_WHITE" to unload cargo.");
}
}
}
return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{

if(Player[playerid][usedMarker])
{
new msg[56];
format(msg, sizeof(msg), "%0.2f Damage", amount);
PlayerTextDrawSetString(playerid, Player[playerid][hitmarkerTD], msg);
PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);
SetTimerEx("hideMarker", 2000, false, "d", playerid);
}
return 1;
}

/************************************************** ************************************************** ******
▀▄▄ ▀▄▄
▄▄▄▄▄▄▓▌ ▐██▄ ▓█▄ ▀▄
░▓▓███████▀ ▄████▌▐██▌ ▐▓
▄▄▄▄▄▄ ▄ █▀██████▓░▄▓████ ▄███▓ ░█▌▄▄▄ ▄ ▄▄▄▄▄▄
█ ▐▌▐▌▐██████▌▐███ ████████▌ █▌ ▐▌ █
█ ▓ ▓███████▄███████ ████▌▐██ ▓ █
█ ▄ ▐▌ ▐▓██████████████ ████▄███ ▐▌ ▄ █
█ ▐▌▐█ ▀▀▀▀▀▓▓█████████ ▀▀ ▓▓░ █▌▐▌ █
█ █░▓▌ ▄▓▄ █████░ ░█▌ ▐▓░█ █
▌▄ ▐▌ ▐█ ▀ ▓▓▄▄▄▄▓▓ █▄▄██████▌ ▀ █▌ ▐▌ ▄▐
▐▌ ▓▄ ▀▓▄ ███████ ███████▓▓ ▄▓▀ ▄▓ ▐▌
▌▀▄ ▀▀▄▄░▀▄ ▀▀▓▓███▌ ▐█░▄▄▄▄ ▀▀ ▄▀░▄▄▀▀ ▄▀▐
▄ █ ▀▀▄▄ ▀▀▄▀▄ ███▀▀▀▀▀▀ ▓███░ ▄▀▄▀▀ ▄▄▀▀ █
▐▌ █ ▀▓▓▄ ▐▌▐▌ ▄▄▄ ▐███▌ ▐██▓▌▐▌▐▌ ▄▓▀ █ ▄ ▄
▄▀ █ ▄ ▐██▌░█▓ ▐█▓▌ ░▓██▓ ▓█░▐█▄ █ ▐▌ ▐▌
▄▀▄▄▀ █ ▐▌ ██▐▓▄▀ ▄▄▀▀▀██▄▄ ▀▄▓▌▐▌ ▀▄▄█░ ▄▀
▐▌▓█▌ ▀ ▄▄█░▐█▓▀ ▄███ ██▓▓ ▓▀ ▄▓██▀ ▄▀▄▄▀
************************************************** ************************************************** **********/