13:41
ОбновитьСмайлыУправление мини-чатом
МИНИ-ЧАТ
Главная страница!

 



 
          





Рекомендуем:





Последние Файлы GTA 4 Последние Файлы GTA-MP Реклама
Скрипт GTA 4 элементы Watch... 07.09.2014
Ferrari 360 Spider [EPM con... 13.12.2013
Porsche Cayenne Turbo 2012 ... 13.12.2013
Shelby Terlingua Mustang v1... 13.12.2013
Hamann Lamborghini Gallardo... 27.10.2013
[GM] The Big PEN1:LS v2.00 ... 04.12.2017
Dgun (AvnanceRP,SampRP,Dimo... 19.03.2016
SAMP скрипт SX Events (MySQ... 03.03.2016
Карта ASL мэрия для SAMP се... 03.03.2016
AIM для SA-MP 0.3.7 22.02.2016
  • Страница 1 из 1
  • 1
Модератор форума: AXE  
Проблема со скритптом
Alexcey666Дата: Пятница, 01.04.2011, 18:40 | Сообщение # 1
Новенький
Группа: Продвинутые
Сообщений: 65
Награды: 0
Город: Киев
Репутация: 0
Замечания: 0%
Статус:
ПОМОГИТЕ я скачал скрипт на новую роботу мне она очень понравилась и я решил боротся кароче

Когда закончил роботу и хочеш забрать деньги становишся на маркет они тебе даются и сразу же отнемаются потомучто в моде стоит анти чит на деньги как зделать так чтоб зароботаное не отнемалось???

Вот скритп

#include <a_samp>

#define DIALOG_RAZDEVALKA 5674
#define COLOR_LIGHTBLUE 0x33CCFFFF
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_GREEN 0x33AA33AA

new cash,clothes;
new bool:Works[MAX_PLAYERS];
new bool:Prorab[MAX_PLAYERS];
new JobCP[MAX_PLAYERS];
new JobAmmount[MAX_PLAYERS];
new OldSkin[MAX_PLAYERS];
new JobOffer[MAX_PLAYERS];
new Employer[MAX_PLAYERS];

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Работа грузчика v_1.0 by denizx");
print("--------------------------------------\n");

cash = CreatePickup(1274, 23, 2127.5701,-2275.1938,20.6719, -1);
clothes = CreatePickup(1275, 23, 2137.9661,-2282.2017,20.6719, -1);
CreateObject(2060,2172.89526367,-2256.86108398,12.46142387,0.00000000,0.00000000,44.00000000);
CreateObject(2060,2172.89453125,-2256.86035156,12.46142387,0.00000000,0.00000000,43.99475098);
CreateObject(2060,2172.42309570,-2256.42822266,12.46099281,0.00000000,0.00000000,47.25003052);
CreateObject(2060,2173.31835938,-2257.36694336,12.46148300,0.00000000,0.00000000,43.75000000);
CreateObject(2060,2172.75854492,-2256.49853516,12.77687645,0.00000000,0.00000000,315.24987793);
CreateObject(2060,2172.41381836,-2256.85815430,12.77693558,0.00000000,0.00000000,316.25000000);
CreateObject(2060,2173.61865234,-2257.31201172,12.77693558,0.00000000,0.00000000,136.00000000);
CreateObject(2060,2173.29321289,-2257.70800781,12.77693558,0.00000000,0.00000000,134.00000000);
CreateObject(2060,2173.73193359,-2257.77856445,12.46504116,0.00000000,0.00000000,42.00000000);
CreateObject(2060,2172.61962891,-2256.63281250,13.09232903,0.00000000,0.00000000,0.00000000);
CreateObject(2060,2229.29809570,-2286.05883789,13.53178787,0.00000000,0.00000000,226.00000000);
CreateObject(2060,2229.61987305,-2286.45825195,13.53178787,0.00000000,0.00000000,45.00000000);
CreateObject(2060,2230.00610352,-2286.81738281,13.53178787,0.00000000,0.00000000,44.00000000);
CreateObject(2060,2230.39746094,-2287.23168945,13.53178787,0.00000000,0.00000000,44.00000000);
CreateObject(2060,2229.35400391,-2286.54858398,13.80724049,0.00000000,0.00000000,134.00000000);
CreateObject(2060,2230.20898438,-2286.95312500,13.82723999,0.00000000,0.00000000,102.00000000);
CreateObject(997,2201.155,-2249.776,12.647,0.0,0.0,135.000);
CreateObject(997,2204.432,-2253.012,12.647,0.0,0.0,135.000);
CreateObject(997,2207.577,-2256.245,12.655,0.0,0.0,135.000);
CreateObject(997,2210.800,-2259.572,12.655,0.0,0.0,135.000);
CreateObject(997,2211.736,-2258.889,12.655,0.0,0.0,45.000);
return 1;
}

public OnPlayerConnect(playerid)
{
Works[playerid] = false;
Prorab[playerid] = false;
JobCP[playerid] = 0;
JobAmmount[playerid] = 0;
OldSkin[playerid] = 0;
JobOffer[playerid] = 999;
Employer[playerid] = 999;
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new idx,giveplayerid;
new cmd[64],tmp[128],string[128],point[128];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/loader",true)==0 || strcmp(cmdtext, "/дщфвук", true) == 0)
{
point = strtok(cmdtext, idx);
if(!strlen(point))
{
SendClientMessage(playerid, 0xFFFFFFFF, "/loader [команда]");
SendClientMessage(playerid, 0xFFFFFFFF, "{008000}[ДОСТУПНО]{FFFFFF} contract - предложить контракт | payday - зарплата");
return 1;
}
if(strcmp(point,"contract",true) == 0)
{
if(Prorab[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Недостаточно прав для использования команды.");
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Чтобы использвать команду, необходимо выйти на работу.");
//if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719)) SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid,0xFFFFFFFF,"/gcontract [id игрока].");
giveplayerid = strval(tmp);
if(giveplayerid == playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не можешь заключть контракт с собой.");
if(Prorab[giveplayerid] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не можешь заключать контракт с прорабом.");
if(Works[giveplayerid] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок уже работает.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
if(JobOffer[giveplayerid] == playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Ты уже предложил игроку контракт.");
JobOffer[giveplayerid] = playerid;
new giveplayer[40],sendername[40];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Ты предложил контакт %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Прораб %s предлагает тебе контракт.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid,0xFFFFFFFF,"/givecontract - подписать контракт (преимущества: $50 за мешок).");
}
if(strcmp(point,"accept",true) == 0)
{
if(JobOffer[playerid] == 999) return SendClientMessage(playerid,0xFFFFFFFF,"Никто не предлагал тебе контракт.");
if(Employer[playerid] != 999) return SendClientMessage(playerid,0xFFFFFFFF,"Ты уже заключал контракт.");
if(Prorab[JobOffer[playerid]] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не прораб.");
if(Works[JobOffer[playerid]] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не на работе.");
//if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719)) SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
if(!IsPlayerConnected(JobOffer[playerid])) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, JobOffer[playerid])) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
new giveplayer[40],sendername[40];
GetPlayerName(JobOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
Employer[playerid] = JobOffer[playerid]; JobOffer[playerid] = 0;
format(string, sizeof(string), "* Ты заключил контакт с %s.", Employer[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s заключил с тобой контракт.", sendername);
SendClientMessage(Employer[playerid], COLOR_LIGHTBLUE, string);
SendClientMessage(Employer[playerid],0xFFFFFFFF,"/gpayday - выдать зарплату.");
}
if(strcmp(point,"payday",true) == 0)
{
if(Prorab[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Недостаточно прав для использования команды.");
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Чтобы использвать команду, необходимо выйти на работу.");
if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719))return SendClientMessage(playerid,0xFFFFFFFF,"Зарплату выдавать можно только в офисе.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid,0xFFFFFFFF,"/gpayday [id игрока].");
giveplayerid = strval(tmp);
if(Employer[giveplayerid] != playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не работает на тебя.");
if(Works[giveplayerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не на работе.");
if(JobAmmount[giveplayerid] == 0) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не перенес ни одного мешка.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
new giveplayer[40];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GivePlayerMoney(playerid,JobAmmount[playerid]*50);
format(string,sizeof(string),"{228B22} Вы получили $%d за свою работу. Приходите еще.",JobAmmount[playerid]*50);
SendClientMessage(playerid,0xFFFFFFFF,string);
GivePlayerMoney(giveplayerid,JobAmmount[playerid]*25);
format(string,sizeof(string),"{228B22} Вы получили $%d от работы %s.",JobAmmount[playerid]*25, giveplayer);
SendClientMessage(giveplayerid,0xFFFFFFFF,string);
JobAmmount[playerid] = 0;
}
return 1;
}
if(strcmp(cmd,"/prorab",true) == 0)
{
Prorab[playerid] = true;
return 1;
}
return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(Works[playerid])
{
if(JobCP[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2172.4146,-2255.5405,13.3041,1.5);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
SetPlayerAttachedObject(playerid, 1 , 2060, 1,0.11,0.36,0.0,0.0,90.0);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
JobCP[playerid] = 2;
}
if(JobCP[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,2.0,2172.4146,-2255.5405,13.3041))
{
new string[64];
JobAmmount[playerid] ++;
format(string,sizeof(string)," Перенесено мешков: %d",JobAmmount[playerid]);
SendClientMessage(playerid,0x33AA33AA,string);
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
new string[128];
if(pickupid == clothes)
{
if(Prorab[playerid] == true)
{
ShowPlayerDialog(playerid,DIALOG_RAZDEVALKA,DIALOG_STYLE_LIST,"\
FreePlay: Работа прорабом","Начать\nЗавершить","Ок","Ок");
}
else
{
ShowPlayerDialog(playerid,DIALOG_RAZDEVALKA,DIALOG_STYLE_LIST,"\
FreePlay: Работа грузчиком","Начать\nЗавершить","Ок","Ок");
}
}
if(pickupid == cash)
{
if(Works[playerid] == false) return SendClientMessage(playerid,0x33AA33AA,"Вы не брали работу.");
if(JobAmmount[playerid] == 0) return SendClientMessage(playerid,0x33AA33AA,"Вы еще ничего не заработали.");
GivePlayerMoney(playerid,JobAmmount[playerid]*25);
format(string,sizeof(string),"Вы получили $%d за свою работу. Приходите еще.",JobAmmount[playerid]*25);
SendClientMessage(playerid,0x33AA33AA,string);
JobAmmount[playerid] = 0;
}
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if(Works[playerid] == true && JobCP[playerid] == 2)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751)) return 1;
SendClientMessage(playerid,0xFF4500AA,"Вы уронили мешок.");
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

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

public OnPlayerUpdate(playerid)
{
if(Works[playerid] == true && JobCP[playerid] == 2)
{
if(IsPlayerApplyAnimation(playerid, "FALL_back") ||
IsPlayerApplyAnimation(playerid, "FALL_collapse") ||
IsPlayerApplyAnimation(playerid, "FALL_fall") ||
IsPlayerApplyAnimation(playerid, "FALL_front") ||
IsPlayerApplyAnimation(playerid, "FALL_glide") ||
IsPlayerApplyAnimation(playerid, "FALL_land") ||
IsPlayerApplyAnimation(playerid, "FALL_skyDive") ||
IsPlayerApplyAnimation(playerid, "JUMP_glide") ||
IsPlayerApplyAnimation(playerid, "JUMP_land") ||
IsPlayerApplyAnimation(playerid, "JUMP_launch") ||
IsPlayerApplyAnimation(playerid, "JUMP_launch_R"))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751)) return 1;
SendClientMessage(playerid,0xFF4500AA,"Вы уронили мешок.");
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RAZDEVALKA)
{
if(listitem == 0)
{
if(Works[playerid] == true) return SendClientMessage(playerid,0x33AA33AA,"[Ошибка]Вы уже взяли работу. Чтобы взять мешок, идите на красную метку на радаре.");
OldSkin[playerid] = GetPlayerSkin(playerid);
Works[playerid] = true; JobAmmount[playerid] = 0; JobCP[playerid] = 1;
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
if(Prorab[playerid] == true)
{
SetPlayerSkin(playerid,27);
SendClientMessage(playerid,0xFF4500AA," Вы можете давать контракты на погрузку и самостоятельно носить мешки.");
SendClientMessage(playerid,0xFFFFFFFF,"/gcontract - выдать контракт /gpayday - выдать заработную плату.");
}
else
{
new skin = random(2);
if(skin == 1) SetPlayerSkin(playerid,260);
else SetPlayerSkin(playerid,16);
SendClientMessage(playerid,0x33AA33AA," Чтобы взять мешок, идите на красную метку на радаре.");
}
}
else if(listitem == 1)
{
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не брал работу.");
if(JobAmmount[playerid] != 0) return SendClientMessage(playerid,0xFFFFFFFF," Сначала вы должны получить зарплату в офисе.");
SendClientMessage(playerid,0x33AA33AA," Вы завершили работу грузчиком.");
Works[playerid] = false; JobAmmount[playerid] = 0; JobCP[playerid] = 0; Employer[playerid] = 999;
SetPlayerSkin(playerid,OldSkin[playerid]);
DisablePlayerCheckpoint(playerid);
}
else return 1;

}
return 1;
}

stock IsPlayerApplyAnimation(playerid, animation[])
{
if(!GetPlayerAnimationIndex(playerid)) return 0;
else
{
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
if(!strcmp(animname, animation, true)) return 1;
}
return 0;
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}


H@OS
[krik]Дата: Пятница, 01.04.2011, 19:12 | Сообщение # 2
Постоялец
Группа: I'm V.I.P.
Сообщений: 434
Награды: 20
Город: Самара
Репутация: 438
Замечания: 0%
Статус:
есть один нормальный вариант решения этой проблемы вшить в мод и всё..
Ну или вшей свой античит в скрипт crazy



Я не говорю, что я изменю мир, но я обещаю, что найду такие слова, которые действительно изменят мир, так что выше нос!
©2pac
Basta-_-Дата: Пятница, 01.04.2011, 19:21 | Сообщение # 3
Уверенный в себе
Группа: Продвинутые
Сообщений: 216
Награды: 2
Город: Riga
Репутация: 76
Замечания: 0%
Статус:
Alexcey666, Вот yes
[cut noguest=Вот все зделал за тебя ]public OnPlayerConnect(playerid)
{
Works[playerid] = false;
Prorab[playerid] = false;
JobCP[playerid] = 0;
JobAmmount[playerid] = 0;
OldSkin[playerid] = 0;
JobOffer[playerid] = 999;
Employer[playerid] = 999;
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new idx,giveplayerid;
new cmd[64],tmp[128],string[128],point[128];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/loader",true)==0 || strcmp(cmdtext, "/дщфвук", true) == 0)
{
point = strtok(cmdtext, idx);
if(!strlen(point))
{
SendClientMessage(playerid, 0xFFFFFFFF, "/loader [команда]");
SendClientMessage(playerid, 0xFFFFFFFF, "{008000}[ДОСТУПНО]{FFFFFF} contract - предложить контракт | payday - зарплата");
return 1;
}
if(strcmp(point,"contract",true) == 0)
{
if(Prorab[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Недостаточно прав для использования команды.");
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Чтобы использвать команду, необходимо выйти на работу.");
//if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719)) SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid,0xFFFFFFFF,"/gcontract [id игрока].");
giveplayerid = strval(tmp);
if(giveplayerid == playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не можешь заключть контракт с собой.");
if(Prorab[giveplayerid] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не можешь заключать контракт с прорабом.");
if(Works[giveplayerid] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок уже работает.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
if(JobOffer[giveplayerid] == playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Ты уже предложил игроку контракт.");
JobOffer[giveplayerid] = playerid;
new giveplayer[40],sendername[40];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Ты предложил контакт %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Прораб %s предлагает тебе контракт.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid,0xFFFFFFFF,"/givecontract - подписать контракт (преимущества: $50 за мешок).");
}
if(strcmp(point,"accept",true) == 0)
{
if(JobOffer[playerid] == 999) return SendClientMessage(playerid,0xFFFFFFFF,"Никто не предлагал тебе контракт.");
if(Employer[playerid] != 999) return SendClientMessage(playerid,0xFFFFFFFF,"Ты уже заключал контракт.");
if(Prorab[JobOffer[playerid]] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не прораб.");
if(Works[JobOffer[playerid]] == true) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не на работе.");
//if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719)) SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
if(!IsPlayerConnected(JobOffer[playerid])) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, JobOffer[playerid])) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
new giveplayer[40],sendername[40];
GetPlayerName(JobOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
Employer[playerid] = JobOffer[playerid]; JobOffer[playerid] = 0;
format(string, sizeof(string), "* Ты заключил контакт с %s.", Employer[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s заключил с тобой контракт.", sendername);
SendClientMessage(Employer[playerid], COLOR_LIGHTBLUE, string);
SendClientMessage(Employer[playerid],0xFFFFFFFF,"/gpayday - выдать зарплату.");
}
if(strcmp(point,"payday",true) == 0)
{
if(Prorab[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Недостаточно прав для использования команды.");
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Чтобы использвать команду, необходимо выйти на работу.");
if(!IsPlayerInRangeOfPoint(playerid,5.0,2127.5701,-2275.1938,20.6719))return SendClientMessage(playerid,0xFFFFFFFF,"Зарплату выдавать можно только в офисе.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid,0xFFFFFFFF,"/gpayday [id игрока].");
giveplayerid = strval(tmp);
if(Employer[giveplayerid] != playerid) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не работает на тебя.");
if(Works[giveplayerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не на работе.");
if(JobAmmount[giveplayerid] == 0) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не перенес ни одного мешка.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Этот игрок не в сети.");
if(!ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Игрок не возле тебя.");
new giveplayer[40];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
AntiMoney[playerid] +=JobAmmount[playerid]*50;
GivePlayerMoney(playerid,JobAmmount[playerid]*50);
format(string,sizeof(string),"{228B22} Вы получили $%d за свою работу. Приходите еще.",JobAmmount[playerid]*50);
SendClientMessage(playerid,0xFFFFFFFF,string);
AntiMoney[playerid] +=JobAmmount[playerid]*25;
GivePlayerMoney(giveplayerid,JobAmmount[playerid]*25);
format(string,sizeof(string),"{228B22} Вы получили $%d от работы %s.",JobAmmount[playerid]*25, giveplayer);
SendClientMessage(giveplayerid,0xFFFFFFFF,string);
JobAmmount[playerid] = 0;
}
return 1;
}
if(strcmp(cmd,"/prorab",true) == 0)
{
Prorab[playerid] = true;
return 1;
}
return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(Works[playerid])
{
if(JobCP[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2172.4146,-2255.5405,13.3041,1.5);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
SetPlayerAttachedObject(playerid, 1 , 2060, 1,0.11,0.36,0.0,0.0,90.0);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
JobCP[playerid] = 2;
}
if(JobCP[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,2.0,2172.4146,-2255.5405,13.3041))
{
new string[64];
JobAmmount[playerid] ++;
format(string,sizeof(string)," Перенесено мешков: %d",JobAmmount[playerid]);
SendClientMessage(playerid,0x33AA33AA,string);
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
new string[128];
if(pickupid == clothes)
{
if(Prorab[playerid] == true)
{
ShowPlayerDialog(playerid,DIALOG_RAZDEVALKA,DIALOG_STYLE_LIST,"\
FreePlay: Работа прорабом","Начать\nЗавершить","Ок","Ок");
}
else
{
ShowPlayerDialog(playerid,DIALOG_RAZDEVALKA,DIALOG_STYLE_LIST,"\
FreePlay: Работа грузчиком","Начать\nЗавершить","Ок","Ок");
}
}
if(pickupid == cash)
{
if(Works[playerid] == false) return SendClientMessage(playerid,0x33AA33AA,"Вы не брали работу.");
if(JobAmmount[playerid] == 0) return SendClientMessage(playerid,0x33AA33AA,"Вы еще ничего не заработали.");
AntiMoney[playerid] +=JobAmmount[playerid]*25;
GivePlayerMoney(playerid,JobAmmount[playerid]*25);
format(string,sizeof(string),"Вы получили $%d за свою работу. Приходите еще.",JobAmmount[playerid]*25);
SendClientMessage(playerid,0x33AA33AA,string);
JobAmmount[playerid] = 0;
}
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if(Works[playerid] == true && JobCP[playerid] == 2)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751)) return 1;
SendClientMessage(playerid,0xFF4500AA,"Вы уронили мешок.");
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

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

public OnPlayerUpdate(playerid)
{
if(Works[playerid] == true && JobCP[playerid] == 2)
{
if(IsPlayerApplyAnimation(playerid, "FALL_back") ||
IsPlayerApplyAnimation(playerid, "FALL_collapse") ||
IsPlayerApplyAnimation(playerid, "FALL_fall") ||
IsPlayerApplyAnimation(playerid, "FALL_front") ||
IsPlayerApplyAnimation(playerid, "FALL_glide") ||
IsPlayerApplyAnimation(playerid, "FALL_land") ||
IsPlayerApplyAnimation(playerid, "FALL_skyDive") ||
IsPlayerApplyAnimation(playerid, "JUMP_glide") ||
IsPlayerApplyAnimation(playerid, "JUMP_land") ||
IsPlayerApplyAnimation(playerid, "JUMP_launch") ||
IsPlayerApplyAnimation(playerid, "JUMP_launch_R"))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,2230.3528,-2286.1353,14.3751)) return 1;
SendClientMessage(playerid,0xFF4500AA,"Вы уронили мешок.");
DisablePlayerCheckpoint(playerid);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,1,0);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
JobCP[playerid] = 1;
}
}
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RAZDEVALKA)
{
if(listitem == 0)
{
if(Works[playerid] == true) return SendClientMessage(playerid,0x33AA33AA,"[Ошибка]Вы уже взяли работу. Чтобы взять мешок, идите на красную метку на радаре.");
OldSkin[playerid] = GetPlayerSkin(playerid);
Works[playerid] = true; JobAmmount[playerid] = 0; JobCP[playerid] = 1;
SetPlayerCheckpoint(playerid,2230.3528,-2286.1353,14.3751,1.5);
if(Prorab[playerid] == true)
{
SetPlayerSkin(playerid,27);
SendClientMessage(playerid,0xFF4500AA," Вы можете давать контракты на погрузку и самостоятельно носить мешки.");
SendClientMessage(playerid,0xFFFFFFFF,"/gcontract - выдать контракт /gpayday - выдать заработную плату.");
}
else
{
new skin = random(2);
if(skin == 1) SetPlayerSkin(playerid,260);
else SetPlayerSkin(playerid,16);
SendClientMessage(playerid,0x33AA33AA," Чтобы взять мешок, идите на красную метку на радаре.");
}
}
else if(listitem == 1)
{
if(Works[playerid] == false) return SendClientMessage(playerid,0xFFFFFFFF,"Ты не брал работу.");
if(JobAmmount[playerid] != 0) return SendClientMessage(playerid,0xFFFFFFFF," Сначала вы должны получить зарплату в офисе.");
SendClientMessage(playerid,0x33AA33AA," Вы завершили работу грузчиком.");
Works[playerid] = false; JobAmmount[playerid] = 0; JobCP[playerid] = 0; Employer[playerid] = 999;
SetPlayerSkin(playerid,OldSkin[playerid]);
DisablePlayerCheckpoint(playerid);
}
else return 1;

}
return 1;
}

stock IsPlayerApplyAnimation(playerid, animation[])
{
if(!GetPlayerAnimationIndex(playerid)) return 0;
else
{
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
if(!strcmp(animname, animation, true)) return 1;
}
return 0;
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}[/cut]

AstarionДата: Пятница, 01.04.2011, 19:31 | Сообщение # 4
Уверенный в себе
Группа: I'm V.I.P.
Сообщений: 173
Награды: 16
Город: Москва
Замечания: 40%
Статус:
надо добавить гдето около 25 строк, я такой пример в моде видел, енпомню как называется, он был created by xXx , там на античит надо ограничение поставить к такому выбору действий. Прсти помочь немогу, это надо в мод лазить, у мя мода by xXx нет :( :( bad bad



Alexcey666Дата: Воскресенье, 30.06.2013, 00:42 | Сообщение # 5
Новенький
Группа: Продвинутые
Сообщений: 65
Награды: 0
Город: Киев
Репутация: 0
Замечания: 0%
Статус:
Закрыто!


H@OS
  • Страница 1 из 1
  • 1
Поиск:





 


 


 
Хостинг от uCoz samp.at.ua