Чемодан
Умник
Добрый день, вот мой код:
public OnPlayerEnterCheckpoint(playerid)
public OnPlayerUpdate(playerid)
Это работа грузчика. Человек встает на пикап, надевает одежду. После этого появляется чекпоинт где брать груз, он бежит туда, берет там груз и появляется новый чекпоинт- где груз положить.
Хочу, чтобы вы мне подсказали, как сделать так, чтобы на взятие и на выгрузку груза появлялся рандомный чекпоинт (из заданных)
public OnPlayerEnterCheckpoint(playerid)
PHP:
if(PlayerToPoint(2.5, playerid,2833.0859,-2496.3464,14.6081) && GetPVarInt(playerid,"pGruz") == 1)
{
Meshok[playerid] = 1;
ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1);
SetPlayerAttachedObject(playerid, 2, 3052, 5, 0.01, 0.1, 0.2, 100, 10, 85);
SetPVarInt(playerid,"pGruz", 2);
SetPlayerCheckpoint(playerid,2800.4092,-2403.3076,13.6306,1.5);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1);
AnimUpdate(playerid);
AnimTimer[playerid] = SetTimerEx("AnimUpdate",5000,true,"i",playerid);
}
if(PlayerToPoint(2.5, playerid,2800.4092,-2403.3076,13.6306) && GetPVarInt(playerid,"pGruz") == 2)
{
Meshok[playerid] = 0;
ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1);
Meshki[playerid]++;
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
format(string, 128, "Ящиков перетащено {A52A2A}%d",Meshki[playerid]);
SendClientMessage(playerid, COLOR_ORANGE, string);
SetPVarInt(playerid,"pGruz", 1);
SetPlayerCheckpoint(playerid,2833.0859,-2496.3464,14.6081,1.5);
KillTimer(AnimTimer[playerid]);
}
PHP:
if(Meshok[playerid] == 1 && !PlayerToPoint(5.0,playerid,2832.8132324219,-2496.7043457031,14.16))
{
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strcmp(animname, "IDLE_STANCE", true) != 0 && strcmp(animname, "RUN_CIVI", true) != 0 && strcmp(animname, "WALK_CIVI", true) != 0 && strcmp(animname, "crry_prtial", true) != 0 && strcmp(animname, "SPRINT_PANIC", true) != 0 && strcmp(animname, "RUN_PLAYER", true) != 0 && strcmp(animname, "WALK_PLAYER", true) != 0 && strcmp(animname, "SPRINT_CIVI", true) != 0)
{
Meshok[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "Вы уронили ящик!");
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1);
SetPlayerCheckpoint(playerid,2833.0859,-2496.3464,14.6081,1.5);
SetPVarInt(playerid,"pGruz", 1);
KillTimer(AnimTimer[playerid]);
}
}
Хочу, чтобы вы мне подсказали, как сделать так, чтобы на взятие и на выгрузку груза появлялся рандомный чекпоинт (из заданных)
