Munka checkpointal:
public OnPlayerEnterCheckpointEx(playerid, checkid)
{
return 1;
}
public OnPlayerLeaveCheckpointEx(playerid, checkid)
{
return 1;
}
Munka Race checkpointal:
public OnPlayerEnterRaceCheckpointEx(playerid, checkid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpointEx(playerid, checkid)
{
return 1;
}
Természetesen a checkid-el lehet \"megkérdezni\" melyik CP-nél van
forráskód:
#include <a_samp>
new checkpoint[MAX_PLAYERS];
new checkpointr[MAX_PLAYERS];
forward OnPlayerEnterCheckpointEx(playerid, checkid);
forward OnPlayerLeaveCheckpointEx(playerid, checkid);
forward OnPlayerEnterRaceCheckpointEx(playerid, checkid);
forward OnPlayerLeaveRaceCheckpointEx(playerid, checkid);
public OnPlayerEnterCheckpoint(playerid)
{
CallLocalFunction(\"OnPlayerEnterCheckpointEx\", \"ii\", playerid, checkpoint[playerid]);
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
CallLocalFunction(\"OnPlayerLeaveCheckpointEx\", \"ii\", playerid, checkpoint[playerid]);
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
CallLocalFunction(\"OnPlayerEnterRaceCheckpointEx\", \"ii\", playerid, checkpointr[playerid]);
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
CallLocalFunction(\"OnPlayerLeaveRaceCheckpointEx\", \"ii\", playerid, checkpointr[playerid]);
return 1;
}
//Ezek alatt az eljárások alatt dolgozol a CP-vel:
public OnPlayerEnterCheckpointEx(playerid, checkid)
{
return 1;
}
public OnPlayerLeaveCheckpointEx(playerid, checkid)
{
return 1;
}
public OnPlayerEnterRaceCheckpointEx(playerid, checkid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpointEx(playerid, checkid)
{
return 1;
}
//És Ezekkel a funkciókkal állítod be azokat és kapcsolod ki:
stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size, id)
{
checkpoint[playerid] = id;
SetPlayerCheckpoint(playerid, x, y, z, size);
}
stock SetPlayerRaceCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size, Float:nx, Float:ny, Float:nz, id)
{
checkpointr[playerid] = id;
SetPlayerRaceCheckpoint(playerid, x, y, z, nx, ny, nz, size);
}
stock DisablePlayerCheckpointEx(playerid)
{
checkpoint[playerid] = 0;
DisablePlayerCheckpoint(playerid);
}
stock DisablePlayerRaceCheckpointEx(playerid)
{
checkpoint[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
}
Használjátok egészséggel!
Letöltés:
http://pastebin.com/UrzdcaKS*nem tudom bárki más publikált volna ilyet, ha igen bocs, nem copy