02.08.2013, 21:29
Cara , use variбveis entгo , tipo quando ele entra em LS por exemplo
Tente ai , mais olhe o cуdigo com atenзгo e adapte-o ao teu GM .
PHP код:
new varGlobal[MAX_PLAYERS];
#define PrefLS 1
#define PrefSF 2
#define PrefLV 3
if(pickupid == entrarpref)
{
GameTextForPlayer(playerid, "~h~~h~~p~Prefeitura", 5000, 8);
SetPlayerVirtualWorld(playerid, 1);//acho q podes remover isto pois nгo serб necessбrio...
SetPlayerPos(playerid,385.4674,173.9319,1008.3828);
SetPlayerInterior(playerid, 3);
varGlobal[playerid] = PrefLS;
return 1;
}
if(pickupid == entrarprefsf)
{
GameTextForPlayer(playerid, "~h~~h~~p~Prefeitura", 5000, 8);
SetPlayerVirtualWorld(playerid, 1);//acho q podes remover isto pois nгo serб necessбrio...
SetPlayerPos(playerid,385.4674,173.9319,1008.3828);
SetPlayerInterior(playerid, 3);
varGlobal[playerid] = PrefSF;
return 1;
}
if(pickupid == entrarpreflv)
{
GameTextForPlayer(playerid, "~h~~h~~p~Prefeitura", 5000, 8);
SetPlayerVirtualWorld(playerid, 1);//acho q podes remover isto pois nгo serб necessбrio...
SetPlayerPos(playerid,385.4674,173.9319,1008.3828);
SetPlayerInterior(playerid, 3);
varGlobal[playerid] = PrefLV;
return 1;
}
//ai tu usa o mesmo pickup pra todas as prefs , '-' . O unico problema й que nгo vais poder fazer lugares diferentes , devem ser as mesmas prefeituras...
if(pickupid == sairpref)
{
if(varGlobal[playerid] == PrefLS)
{
SetPlayerVirtualWorld(playerid, 0);// acho q podes remover isto pois nгo serб necessбrio...
SetPlayerPos(playerid,1154.3585,-1768.6331,16.5938);
SetPlayerInterior(playerid, 0);
varGlobal[playerid] = 0;// 0 significa que nao ta em nenhuma das prefs...
return 1;
}
else if(varGlobal[playerid] == PrefSF)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,-2168.5779,251.6242,35.3294);
SetPlayerInterior(playerid, 0);
varGlobal[playerid] = 0;
return 1;
}
else if(varGlobal[playerid] == PrefLV)
{
//bota os treco de LV aki pois eu nao sei quais sгo kkkk
varGlobal[playerid] = 0;
return 1;
}
}