_MUNDO _PREF_LS _PREF_SF _DP_LS |
enum INTERIOR_INFO
{
I_interior,
I_nome[32]
}
enum INTERIORES
{
_MUNDO,
_PREF_LS,
_PREF_SF,
_DP_LS
}
//primeiro valor й o interior (й a parte visual do mapa que o local pertence)
//segundo valor й o nome (caso precise utilizar em algum momento)
new _Interior[INTERIORES][INTERIOR_INFO]=
{
{0, "Mundo"},
{3, "Prefeitura LS"},
{3, "Prefeitura SF"},
{6, "Delegacia LS"}
}
//sabendo essas informaзхes e as armazenando pode simplesmente esquece-las
//este macro vai te ajudar em diversas aplicaзхes tanto suas quantos de terceiros (SIF,STREAMER,MCF-CP)
#define INTERIOR<%0> _:%0,_Interior[%0][I_interior]
stock GetWord(i)
return _:i;
stock GetInterior(i)
return _:_Interior[_:i][I_interior];
stock GetInteriorNome(wordid)
return _Interior[_:wordid][I_nome];
//caso nгo tenha um script de teleporte similar, aqui estб o meu:
function TeleportCP(playerid, Float:x, Float:y, Float:z,wd,i)
{
SetPlayerInterior(playerid, i);
SetPlayerPos(playerid, x,y,z);
SetPlayerVirtualWorld(playerid, wd);
return 1;
}
public OnGameModeInit()
{
CreateButton(244.898437,73.343383,1003.000,"",INTERIOR<_DP_LS>); // SIF
CreateDynamicObject(19273, 247.75360, 72.38390, 1004.00000, 0.00000, 0.00000, 0.00000,INTERIOR<_DP_LS>);//Streamer
CreateCheckPoint("dp", CP_CIRCLE, 0x99FF0000, 249.3933,69.7072, 1003.6406,INTERIOR<_DP_LS>);//MCF-CP
return 1;
}
#include <MCF-CP>
#include <streamer>
//MACROS para facilitar visualisгo e abreviaзгo do codigo
#define TELEPORTE_FROM_POS<%0> _TELE[%0][FromX],_TELE[%0][FromY],_TELE[%0][FromZ],INTERIOR<INTERIORES:_TELE[%0][Fi]>
#define TELEPORTE_TO_POS<%0> _TELE[%0][ToX],_TELE[%0][ToY],_TELE[%0][ToZ],INTERIOR<INTERIORES:_TELE[%0][Ti]>
#define MAX_TELEPORTES 5
static CPT[MAX_TELEPORTES]; //CheckPoint Teleporte
static LastCPT[MAX_PLAYERS]; //ultimo CheckPoint de telerpote
enum TELE_INFO
{
Float:FromX,
Float:FromY,
Float:FromZ,
Fi,
Float:ToX,
Float:ToY,
Float:ToZ,
Ti,
Tmessage[100]
}
static _TELE[MAX_TELEPORTES][TELE_INFO]=
{
{246.7840,63.9002,1003.6406,_:_DP_LS, 1553.9879,-1675.4504,16.2953, _:_MUNDO, "~w~Precisone: ~g~~h~(F)~w~ para sair da delegacia"},
{246.3030,87.2807,1003.6406,_:_DP_LS, 1525.4456,-1678.0431,5.8906, _:_MUNDO, "~w~Precisone: ~g~~h~(F)~w~ para sair da delegacia"},
{1553.9879,-1675.4504,16.2953,_:_MUNDO, 246.7840,63.9002, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
{1568.6914,-1691.1642,5.8906,_:_MUNDO, 246.3030,87.2807, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
{1525.4456,-1678.0431,5.8906,_:_MUNDO, 246.3030,87.2807, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
};
public OnGameModeInit()
{
for(new i = 0; i < MAX_TELEPORTES; i++)//criaзгo de todos os CheckPoint de teleporte
CPT[i]=CreateCheckPoint("entrar", CP_INVISIBLE , 0x99FF0000, TELEPORTE_FROM_POS<i>);
//-------------------------------------
CreateDynamicPickup(19197, 1,246.7840,63.9002, 1003.64044, INTERIOR<_DP_LS>);//visual dos pickups sгo bem bonitos
CreateDynamicPickup(19197, 1,246.3030,87.2807, 1003.64044, INTERIOR<_DP_LS>);
CreateDynamicPickup(19197, 1,1553.9879,-1675.4504,16.2953, INTERIOR<_MUNDO>);
CreateDynamicPickup(19197, 1,1525.4456,-1678.0431,5.89060, INTERIOR<_MUNDO>);
CreateDynamicPickup(19197, 1,1568.6914,-1691.1642,5.8906, INTERIOR<_MUNDO>);
//----------------------------------------
return 1;
}
CPEnter:entrar(playerid, CPID)
{
for(new i = 0; i < MAX_TELEPORTES; i++)
{
if(IsPlayerInCP(playerid, CPT[i]))
{
GameTextForPlayer(playerid, _TELE[i][Tmessage], 4000, 4);
LastCPT[playerid]=i;
return 1;
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
return 1;
if(!PRESSED(KEY_SECONDARY_ATTACK))
return 1;
if(IsPlayerInCP(playerid,CPT[LastCPT[playerid]]))
return TeleportCP(playerid, TELEPORTE_TO_POS<LastCPT[playerid]>);
return 1;
}
static _TELE[MAX_TELEPORTES][TELE_INFO]=
{
{246.7840,63.9002,1003.6406,_:_DP_LS, 1553.9879,-1675.4504,16.2953, _:_MUNDO, "~w~Precisone: ~g~~h~(F)~w~ para sair da delegacia"},
{246.3030,87.2807,1003.6406,_:_DP_LS, 1525.4456,-1678.0431,5.8906, _:_MUNDO, "~w~Precisone: ~g~~h~(F)~w~ para sair da delegacia"},
{1553.9879,-1675.4504,16.2953,_:_MUNDO, 246.7840,63.9002, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
{1568.6914,-1691.1642,5.8906,_:_MUNDO, 246.3030,87.2807, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
{1525.4456,-1678.0431,5.8906,_:_MUNDO, 246.3030,87.2807, 1003.6406, _:_DP_LS, "~w~Precisone: ~g~~h~(F)~w~ para entrar na delegacia"},
};
RazorG: Tutorial e Elaboraзгo do Cуdigo! |
Tutorial ficou muito bom, e simples, mas vocк pode disponibilizar a include MCF-CP ? Nгo estou conseguindo acha-la.
|
C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(460) : error 025: function heading differs from prototype
C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(460) : error 017: undefined symbol "areaid" C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(464) : error 021: symbol already defined: "Streamer_GetArrayData" C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(465) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(471) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(47 : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(483) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(48 : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(490) : error 054: unmatched closing brace ("}") C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(503) : error 025: function heading differs from prototype C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(503) : error 017: undefined symbol "areaid" C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(506) : error 021: symbol already defined: "arr" C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(50 : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(512) : error 021: symbol already defined: "CPID" C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(514) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(521) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(526) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(531) : error 010: invalid function or declaration C:\Users\Lawlliet\Desktop\Meu servidor\pawno\include\cp.inc(533) : error 054: unmatched closing brace ("}") C:\Users\Lawlliet\Desktop\entrada.pwn(111) : error 017: undefined symbol "CreateButton" C:\Users\Lawlliet\Desktop\entrada.pwn(111) : warning 202: number of arguments does not match definition C:\Users\Lawlliet\Desktop\entrada.pwn(111) : error 001: expected token: ",", but found ";" C:\Users\Lawlliet\Desktop\entrada.pwn(112) : error 017: undefined symbol "INTERIOR" C:\Users\Lawlliet\Desktop\entrada.pwn(112) : error 001: expected token: ",", but found ";" C:\Users\Lawlliet\Desktop\entrada.pwn(113) : error 017: undefined symbol "INTERIOR" C:\Users\Lawlliet\Desktop\entrada.pwn(113) : error 001: expected token: ",", but found ";" C:\Users\Lawlliet\Desktop\entrada.pwn(117) : error 017: undefined symbol "MAX_TELEPORTES" Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors. O meu deu esses erros, em linhas que nгo tem. https://pastebin.com/w39ExQEP Tentei colocar ele em um new.pwn |