shape1
shape2
shape3
shape4
shape7
shape8

Система пропуска


mitinko

Новичок
Пользователь
30.12.2014
8
0
0
Спойлер
forward LoadPickup();
public LoadPickup()
{
new time = GetTickCount();
new rows, fields;

cache_get_data(rows, fields);

for(new idx = 1; idx <= rows; idx++)
{
e_info[idx][e_id] = cache_get_field_content_int(idx-1, "id");
e_info[idx][e_x] = cache_get_field_content_float(idx-1, "e_x");
e_info[idx][e_y] = cache_get_field_content_float(idx-1, "e_y");
e_info[idx][e_z] = cache_get_field_content_float(idx-1, "e_z");
e_info[idx][e_r] = cache_get_field_content_float(idx-1, "e_r");
e_info[idx][v_x] = cache_get_field_content_float(idx-1, "v_x");
e_info[idx][v_y] = cache_get_field_content_float(idx-1, "v_y");
e_info[idx][v_z] = cache_get_field_content_float(idx-1, "v_z");
e_info[idx][v_r] = cache_get_field_content_float(idx-1, "v_r");
e_info[idx][e_int] = cache_get_field_content_int(idx-1, "e_int");
e_info[idx][e_world] = cache_get_field_content_int(idx-1, "e_world");
e_info[idx][e_types] = cache_get_field_content_int(idx-1, "type");
e_info[idx][e_dostup] = cache_get_field_content_int(idx-1, "dostup");
e_info[idx][e_fraction] = cache_get_field_content_int(idx-1, "fraction");

e_info[idx][p_pic_enter] = CreateDynamicPickup(1318, 1, e_info[idx][e_x], e_info[idx][e_y], e_info[idx][e_z]);
e_info[idx][p_pic_exit] = CreateDynamicPickup(1318, 1, e_info[idx][v_x], e_info[idx][v_y], e_info[idx][v_z], e_info[idx][e_world]);
e_info[idx][p_text_enter] = CreateDynamic3DTextLabel("{EF9B15}Вход: ALT", COLOR_WHITE, e_info[idx][e_x], e_info[idx][e_y], e_info[idx][e_z],2.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1, 0, 0);
e_info[idx][p_text_exit] = CreateDynamic3DTextLabel("{EF9B15}Выход: ALT", COLOR_WHITE, e_info[idx][v_x], e_info[idx][v_y], e_info[idx][v_z],2.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1, e_info[idx][e_world], e_info[idx][e_int]);

TOTALENTER++;

}
printf("[Загружено пикапов]: <%d>. Потрачено: <%i ms>.", TOTALENTER, GetTickCount() - time);
return 1;
}





...

for(new idx = 1; idx <= TOTALENTER; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, e_info[idx][e_x], e_info[idx][e_y], e_info[idx][e_z]))
{
if(e_info[idx][e_dostup] && (e_info[idx][e_fraction] != PI[playerid][pMember] && !IsACop(playerid))) return SendClientMessage(playerid, COLOR_RED, "Нет пропуска");
TeleportFreeze(playerid, 3000); PG_SetPlayerPos(playerid, e_info[idx][v_x], e_info[idx][v_y], e_info[idx][v_z]);
SetPlayerFacingAngle(playerid, e_info[idx][v_r]);
SetPlayerInterior(playerid, e_info[idx][e_int]);
if(e_info[idx][e_types] == 3)
{
SetPlayerVirtualWorld(playerid, playerid+1);
SendMes(playerid, COLOR_GREEN, "Вы попали в тир-комнату №%d", playerid+1);
}
else SetPlayerVirtualWorld(playerid, e_info[idx][e_world]);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, e_info[idx][v_x], e_info[idx][v_y], e_info[idx][v_z]))
{
if(e_info[idx][e_world] == GetPlayerVirtualWorld(playerid) || (GetPlayerVirtualWorld(playerid) == playerid+1 && e_info[idx][e_types] == 3))
{
if(PI[playerid][pJail] > 0 && e_info[idx][e_types] == 1) return SendClientMessage(playerid, COLOR_RED, "Вы еще не отсидели свой срок");
if((PlayerDied[playerid] == true || PI[playerid][pHeal] < 99.00) && e_info[idx][e_types] == 2) return SendClientMessage(playerid,COLOR_RED,"Вы не прошли курс лечения");
if(e_info[idx][e_dostup] && e_info[idx][e_fraction] != PI[playerid][pMember]) return SendClientMessage(playerid, COLOR_RED, "Нет пропуска");
TeleportFreeze(playerid, 3000); PG_SetPlayerPos(playerid, e_info[idx][e_x], e_info[idx][e_y], e_info[idx][e_z]);
SetPlayerFacingAngle(playerid, e_info[idx][e_r]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
}
}





как сделать из ходя из этих функций команду для выдачи пропуска

 
Последнее редактирование модератором: