01.01.2014, 15:41
pawn Код:
#include <a_samp>
#include <zcmd>
new RutaCP[MAX_PLAYERS],
bool:EstaEnRuta[MAX_PLAYERS];
COMMAND:comenzar(playerid, params[]){
if(EstaEnRuta[playerid]) return SendClientMessage(playerid,-1,"INFO: Usted ya se encuentra en la ruta de CP!.");
EstaEnRuta[playerid]=true;
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
SendClientMessage(playerid,-1,"INFO: Usted ha comenzado la ruta de CP!.");
return true;
}
COMMAND:terminar(playerid, params[]){
if(!EstaEnRuta[playerid]) return SendClientMessage(playerid,-1,"INFO: Usted no se encuentra en la ruta de CP!.");
EstaEnRuta[playerid]=false;
RutaCP[playerid]=0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,-1,"INFO: Usted ha terminado la ruta de CP!.");
return true;
}
public OnPlayerEnterCheckpoint(playerid){
switch(RutaCP[playerid]){
case 1:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 2:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 3:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 4:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 5:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 6:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 7:{
RutaCP[playerid]++;
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
DisablePlayerCheckpoint(playerid);
//TU FUNCION
}
case 8:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 9:{
RutaCP[playerid]++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
//TU FUNCION
}
case 10:{
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/terminar");
//TU FUNCION
}
}
return true;
}
https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint