04.08.2011, 11:19
Hey, i made a /collectgarbage command for Garbage man job, it creates a Dynamic CP defined as GarbageCheckpoint1 when player enter it it should create another checkpoint. But when i entered the checkpoint nothing happened. i think that there might be a problem with My OnPlayerEnterDynamicCP callback.
here it is
Thanks for helping.
here it is
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == GarbageCheckpoint1)
{
new string[128];
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0,0,0,0,0,0);
GarbageCheckpoint2 = CreateDynamicCP(-349.1976,1544.5193,75.5625, -1, -1, playerid);
SendClientMessage(playerid, GREEN, "Go to next checkpoint.");
format(string, sizeof(string), "%s collects some garbage and puts them in his plastic bag.", GetICName(playerid));
SendRPChatMessage(playerid, ACTION_COLOR, string, 5);
}
if(checkpointid == GarbageCheckpoint2)
{
new string[128];
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0,0,0,0,0,0);
GarbageCheckpoint3 = CreateDynamicCP(-361.4394,1572.8923,75.9229, -1, -1, playerid);
SendClientMessage(playerid, GREEN, "Go to next checkpoint.");
format(string, sizeof(string), "%s collects some garbage and puts them in his plastic bag.", GetICName(playerid));
SendRPChatMessage(playerid, ACTION_COLOR, string, 5);
}
if(checkpointid == GarbageCheckpoint3)
{
new string[128];
ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0,0,0,0,0,0);
SendClientMessage(playerid, GREEN, "You have finished your work.");
format(string, sizeof(string), "%s puts the plastic bag inside the garbage bin.", GetICName(playerid));
SendRPChatMessage(playerid, ACTION_COLOR, string, 5);
PlayerStat[playerid][CollectingGarbage] = 0;
PlayerStat[playerid][AbleToCollectGarbage] = 0;
JobID1ReloadTimer = SetTimer("JobID1ReloadTime", 60000, false);
}
return 1;
}

