PDA

View Full Version : [Tutorial] CheckPoint


SkL_MD
18/06/2012, 12:18 PM
In acest tutorial am sa va invat cum sa faceti un Checkpoint

Mai īntai de toate aveti nevoie pawno
In al doilea rand ai nevoie de ceva cunostinte de baza pawno

Include:
#include <a_samp>
#include <zcmd>
Voi folosi ZCMD

Definim:
#define COLOR_WHITE 0xFFFFFFAA

Mergem sus in script si adaugam:
new CP[MAX_PLAYERS];

Creeam comanda:
CMD:lucru(playerid, params[])
{
CP[playerid] =1;
SetPlayerCheckpoint(playerid, 1577.3411,1504.8600,10.5608, 4.0); //Aeroportul LV
SendClientMessage(playerid,COLOR_WHITE,"Mesajul");
return 1;
}

Mergem la OnPlayerCheckpoint:
public OnPlayerEnterCheckpoint(playerid)
{
if (CP[playerid] ==1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_WHITE"Mesajul");
GivePlayerMoney(playerid, +15000);
}
return 1;
}
Acum sa creeam comanda pentru stop:
CMD:stop(playerid, params[])
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Mesajul");
GivePlayerMoney(playerid, -1000);
return 1;
}

Cod final:
#include <a_samp>
#include <zcmd>
#define COLOR_WHITE 0xFFFFFFAA
new CP[MAX_PLAYERS];
CMD:lucru(playerid, params[])
{
CP[playerid] =1;
SetPlayerCheckpoint(playerid, 1577.3411,1504.8600,10.5608, 4.0);
SendClientMessage(playerid,COLOR_WHITE,"Mesajul");
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if (CP[playerid] ==1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_WHITE"Mesajul");
GivePlayerMoney(playerid, +15000);
}
return 1;
CMD:stop(playerid, params[])
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Mesajul");
GivePlayerMoney(playerid, -1000);
return 1;
}
}

Sper ca ati inteles ceva din acest tutorial :)

Skaizo
18/06/2012, 12:57 PM
:))
ai creat brackets si 4 erori
si pentru ce ai creat comanda stop?
atat ai creat checkpoint?ehh...asta nui tot,CreateDynamicCP,
si
public OnPlayerEnterCheckpoint(playerid)
{
if (CP[playerid] ==1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_WHITE"Mesajul");
GivePlayerMoney(playerid, +15000);
}
si return 1; dupa brackets?:))