#include <a_samp>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000C8
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
enum {
STAGE_IDLE,
STAGE_UNLOAD,
STAGE_LOAD
}
new MissionStage[MAX_PLAYERS];
new Float: gAirports[][] = {
{ 1579.6099,1460.0630,10.8307},//lva
{ -1353.9780,-238.9976,14.1484 },//sfa
{ 1563.6893,-2449.4089,13.5547 },//lsa
{ 389.6915,2530.2002,16.5391 }//vma
};
public OnPlayerConnect(playerid) {
MissionStage[playerid] = STAGE_IDLE;
return true;
}
AirportMissionStart(playerid) {
if(MissionStage[playerid] == STAGE_IDLE) {
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519) {
new
idx,
Float: tmp,
Float: dist = GetPlayerDistanceFromPoint(playerid, gAirports[0][0], gAirports[0][1], gAirports[0][2])
;
for(new i = 1; i < sizeof gAirports; ++i) {
tmp = GetPlayerDistanceFromPoint(playerid, gAirports[i][0], gAirports[i][1], gAirports[i][2]);
if(tmp < dist) {
dist = tmp;
idx = i;
}
}
MissionStage[playerid] = STAGE_LOAD + idx;
return SetPlayerCheckpoint(playerid, gAirports[idx][0], gAirports[idx][1], gAirports[idx][2], 20.0);
}
}
return false;
}
AirportMissionEnd(playerid) {
if(MissionStage[playerid] != STAGE_IDLE) {
MissionStage[playerid] = STAGE_IDLE;
return DisablePlayerCheckpoint(playerid);
}
return false;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (strcmp("/Work", cmdtext, true) == 0) {
if(AirportMissionStart(playerid)) {
SendClientMessage(playerid, COLOR_INDIGO, "You have Started your Work !");
return true;
}
return SendClientMessage(playerid, COLOR_RED, "You are already in a work!");
}
if (strcmp("/dsstgrdy6uy6uyh6tuu7yu67u7uuj767ikiy7i5u756y765 m7y65m76576575m757rtyhfhgj67uj7yujgfjhgjhgjhgjhgjgh6757567ygjhgj65765765hytjhgj6675765", cmdtext, true) == 0) {
if(AirportMissionEnd(playerid)) {
GivePlayerMoney(playerid, -10000);
return SendClientMessage(playerid, COLOR_RED, "You had Paid $10,000 for stopping your Work!");
}
return true;
}
return false;
}
public OnPlayerEnterCheckpoint(playerid) {
switch(MissionStage[playerid]) {
case STAGE_IDLE: {} // do not remove
case STAGE_UNLOAD: {
new
string[64]
;
FreezePlayer(playerid, 3000);
DisablePlayerCheckpoint(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
GivePlayerMoney(playerid, 1500 + random(4000));
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
strcat(string, " Completed a Flight!");
SendClientMessageToAll(COLOR_ORANGE, string);
MissionStage[playerid] = STAGE_IDLE;
}
default: { // STAGE_LOAD
new
rand = random(sizeof gAirports - 1)
;
if(rand == (MissionStage[playerid] - STAGE_LOAD)) {
rand++;
}
FreezePlayer(playerid, 3000);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~All Set !", 2000, 4);
SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
MissionStage[playerid] = STAGE_UNLOAD;
}
}
return false;
}
public OnPlayerDeath(playerid, killerid, reason) {
AirportMissionEnd(playerid);
return true;
}
forward FreezePlayer(playerid, time);
public FreezePlayer(playerid, time) {
if(0 < time) {
SetTimerEx("FreezePlayer", time, false, "ii", playerid, 0);
}
TogglePlayerControllable(playerid, !time);
}
new Cash[MAX_PLAYERS];
stock GivePlayerCash(playerid, money)
{
return Cash[playerid] += money;
}
stock GetPlayerCash(playerid)
{
return Cash[playerid];
}
stock ResetPlayerCash(playerid)
{
return Cash[playerid] = 0;
}
GivePlayerCash(playerid, money);
GivePlayerCash(playerid, 1500 + random(4000));
new Pool[MAX_PLAYERS];
stock GivePlayerPool(playerid, money)
{
Pool[playerid] += money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Pool[playerid]);
PlayerInfo[playerid][pCash] += money;
SaveKonVal(playerid, "pCash", Pool[playerid]);
return Pool[playerid];
}
stock GetPlayerPool2(playerid, money)
{
Pool[playerid] -= money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Pool[playerid]);
SaveKonVal(playerid, "pCash", Pool[playerid]);
return Pool[playerid];
}
stock SetPlayerPool(playerid, money)
{
Pool[playerid] = money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Pool[playerid]);
SaveKonVal(playerid, "pCash", Pool[playerid]);
return Pool[playerid];
}
stock ResetPlayerPool(playerid)
{
Pool[playerid] = 0;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Pool[playerid]);
SaveKonVal(playerid, "pCash", Pool[playerid]);
return Pool[playerid];
}
stock GetPlayerPool(playerid)
{
return Pool[playerid];
}
PHP код:
Pool = Money |
GivePlayerPooL(playerid, money);
ResetPlayerPooL(playerid);
GetPlayerPooL(playerid);