Vovka[KarlitoS]
Умник
Ко всем new
в enum pInfo
В public OnPlayerConnect(playerid)
В public PayDay()
В public OnPlayerRegister(playerid, password[])
В команды
В /usedrugs
В public OnPlayerDisconnect(playerid, reason)
На этом всё) надеюсь я заслужил +
PHP:
new send[MAX_PLAYERS];
new startnarko[MAX_PLAYERS];
new seans[MAX_PLAYERS];
PHP:
pNarcoZavisimost,
pNarcoLomka,
PHP:
PlayerInfo[playerid][pNarcoLomka] = 0;// нарко ломка
PlayerInfo[playerid][pNarcoZavisimost] = 0;//нарко зависимость
startnarko[playerid] = 0;
PHP:
if(PlayerInfo[i][pNarcoZavisimost] >= 100)
{
startnarko[i] = 1;
send[i] = 0;
}
if(startnarko[i] == 1)
{
if(PlayerInfo[i][pNarcoZavisimost] >= 100)
{
if(send[i] == 0)
{
SendClientMessage(i, COLOR_RED, "У вас началась ломка");
SendClientMessage(i, COLOR_WHITE, "(( Принять дозу: /usedrugs | Вызвать скорую: /service ))");
send[i] = 1;
}
ApplyAnimation(i, "CRACK", "crckdeth1", 4.0, 1, 0, 0, 0, 0);
send[i] = 1;
}
}
seans[i] = 0;
PHP:
ini_setInteger(File,"NarcoZavisimost",PlayerInfo[playerid][pNarcoZavisimost]);
ini_setInteger(File,"NarcoLomka",PlayerInfo[playerid][pNarcoLomka]);
В public OnPlayerUpdate_GF(playerid)
ini_setInteger(File,"NarcoZavisimost",PlayerInfo[playerid][pNarcoZavisimost]);
ini_setInteger(File,"NarcoLomka",PlayerInfo[playerid][pNarcoLomka]);
В public OnPlayerLogin(playerid,password[])
ini_getInteger(File,"NarcoZavisimost",PlayerInfo[playerid][pNarcoZavisimost]);
ini_getInteger(File,"NarcoLomka",PlayerInfo[playerid][pNarcoLomka]);
PHP:
if(strcmp(cmd, "/narkozav", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pMember] == 22)
{
tmp = strtok(cmdtext, idx);
new plo;
plo = ReturnUser(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "{F74848}» Введите: {FFFFFF} /narkozav [id]");
new giveambu = GetPlayerVehicleID(plo);
new playambu = GetPlayerVehicleID(playerid);
if (IsAnAmbulance(playambu) && playambu == giveambu)
{
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(seans[plo] == 1) return SendClientMessage(playerid,COLOR_GREEN,"Следущий сеанс можно провести через час");
if(PlayerInfo[plo][pNarcoZavisimost] <= 100)return SendClientMessage(playerid,COLOR_GREEN,"У пациенат нет зависимости");
if(plo == playerid) return SendClientMessage(playerid,COLOR_GRAD1,"Вы указали свой ID");
PlayerInfo[plo][pNarcoZavisimost] -= 500;
SetPlayerWeather(plo, 7);
GetPlayerName(playerid,sendername,sizeof(sendername));
GetPlayerName(plo,giveplayer,sizeof(giveplayer));
format(string,sizeof(string),"Медик %s провёл с вами сеанс от наркозависимости",sendername);
SendClientMessage(plo,COLOR_GREEN,string);
format(string,sizeof(string),"Вы провели сеанс от наркозависимости с %s",giveplayer);
SendClientMessage(playerid,COLOR_GREEN,string);
seans[plo] = 1;
}
}
else
{
format(string, sizeof(string), "Человек не найден", plo);
SendClientMessage(playerid, COLOR_RED, string);
return true;
}
}
else return SendClientMessage(playerid,COLOR_GREY,"Один из вас не в медецинской машине");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не Медик!");
}
}
return true;
}
//=============================================================================================
if(strcmp(cmd, "/lomka", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pMember] == 22)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_WHITE, "Введите: /lomka [id]");
new plo;
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(plo == playerid)return SendClientMessage(playerid,COLOR_GRAD1,"[Ошибка] Вы указали свой ID");
PlayerStoned[plo] = 0;
SetPlayerWeather(plo,14);
GetPlayerName(playerid,sendername,sizeof(sendername));
GetPlayerName(plo,giveplayer,sizeof(giveplayer));
format(string,sizeof(string),"Вы спасли %s от ломки",giveplayer);
SendClientMessage(playerid,COLOR_GREEN,string);
format(string,sizeof(string),"Медик %s спас вас от ломки",sendername);
SendClientMessage(plo,COLOR_GREEN,string);
startnarko[plo] = 0;
send[plo] = 0;
ApplyAnimation(plo,"CARRY","crry_prtial",4.0,0,0,0,0,0,1);
}
}
else
{
format(string, sizeof(string), "Человек не найден", plo);
SendClientMessage(playerid, COLOR_RED, string);
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не Медик!");
}
}
return true;
}
PHP:
new lomka = PlayerInfo[playerid][pNarcoLomka];
lomka += 1;
new zavisimost = lomka+1;
PlayerInfo[playerid][pNarcoZavisimost] += zavisimost;
format(string, sizeof(string), "* Ваша нарко зависимость составляет: %d, у вас может начаться ломка", PlayerInfo[playerid][pNarcoZavisimost]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PHP:
if(startnarko[playerid] == 1)
{
ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.0, 1, 0, 0, 0, 0);
}
