[AJUDA]ResetPlayerWeapons -
RedBulL_x - 08.12.2011
Estava tentando criar uma Favela e quando entrasse na GangZone da Favela ganhasse o kit de armas e quando sair retirasse essas armas. Mas nгo esta dando muito certo quando eu entro na favela fico ganhando e resetando as armas. Segue o CODE se alguйm poder me ajudar eu agradeзo, REPUT!
Код:
public locais(playerid)
for (new i=0;i<MAX_PLAYERS;i++){
if(IsPlayerConnected(i)){
//======================= Favela ==========================
if(IsPlayerInPlace(i,2016.010986, -1161.922363, 2324.010986, -923.518310)){
DMLiberado2[i] = 1;
GangZoneFlashForAll(favela,0xFFFFFFAA);
GameTextForPlayer(i,"DM Liberado",1000,1);
GivePlayerWeapon(i, 24, 999);
GivePlayerWeapon(i, 9, 1);
GivePlayerWeapon(i, 25, 999);
GivePlayerWeapon(i, 26, 999);
GivePlayerWeapon(i, 30, 999);
GivePlayerWeapon(i, 32, 999);
} else {
if(DMLiberado2[i] == 1){
DMLiberado2[i] = 0;
GangZoneStopFlashForAll(favela);
ResetPlayerWeapons(playerid);
}
}
Re: [AJUDA]ResetPlayerWeapons -
Bruno[]Lima - 08.12.2011
Arrumei o cуdigo e identei. Tente agora, lembrando que nгo testei, mas acho que irб funcionar!
pawn Код:
// ~~> Topo:
new EntrouFavela[MAX_PLAYERS], SaiuFavela[MAX_PLAYERS];
public locais(playerid)
{
for (new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
//======================= Favela ==========================
if(IsPlayerInPlace(i,2016.010986, -1161.922363, 2324.010986, -923.518310))
{
EntrouFavela[i] = 1;
if(EntrouFavela[1] == 1)
{
DMLiberado2[i] = 1;
GangZoneFlashForAll(favela,0xFFFFFFAA);
GameTextForPlayer(i,"DM Liberado",1000,1);
GivePlayerWeapon(i, 24, 999);
GivePlayerWeapon(i, 9, 1);
GivePlayerWeapon(i, 25, 999);
GivePlayerWeapon(i, 26, 999);
GivePlayerWeapon(i, 30, 999);
GivePlayerWeapon(i, 32, 999);
EntrouFavela[i] = 0;
}
else
{
if(DMLiberado2[i] == 1)
{
if(SaiuFavela[i] == 1)
{
DMLiberado2[i] = 0;
GangZoneStopFlashForAll(favela);
ResetPlayerWeapons(i);
SaiuFavela[i] = 0;
}
}
Respuesta: [AJUDA]ResetPlayerWeapons -
RedBulL_x - 08.12.2011
Man nгo deu certo, apareceu os seguintes erros.
Код:
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(1246) : error 004: function "CarregCar" is not implemented
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2184) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2185) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2186) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2187) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2188) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2189) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2190) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2200) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2201) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2202) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2199) : warning 204: symbol is assigned a value that is never used: "index"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2682) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2682) : error 033: array must be indexed (variable "cmd")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2977) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2977) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2983) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(2983) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3020) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3020) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3041) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3041) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3110) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3110) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3141) : error 017: undefined symbol "strtok"
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3141) : error 033: array must be indexed (variable "tmp")
C:\Users\micro\Desktop\SAMP\Brasil CityGames RPG [GM]\gamemodes\RPG.pwn(3170) : error 017: undefined symbol "strtok"
Re: [AJUDA]ResetPlayerWeapons -
lucas_mdr1235 - 08.12.2011
apaga o seu e coloca esse aki
PHP код:
public locais(playerid)
{
if(IsPlayerConnected(playerid))
{
//======================= Favela ==========================
if(IsPlayerInPlace(playerid,2016.010986, -1161.922363, 2324.010986, -923.518310))
{
DMLiberado2[playerid] = 1;
GangZoneFlashForAll(favela,0xFFFFFFAA);
GameTextForPlayer(playerid,"DM Liberado",1000,1);
GivePlayerWeapon(playerid, 24, 999);
GivePlayerWeapon(playerid, 9, 1);
GivePlayerWeapon(playerid, 25, 999);
GivePlayerWeapon(playerid, 26, 999);
GivePlayerWeapon(playerid, 30, 999);
GivePlayerWeapon(playerid, 32, 999);
}
else
{
DMLiberado2[playerid] = 0;
GangZoneStopFlashForAll(favela);
ResetPlayerWeapons(playerid);
}
}
return 1;
}
Respuesta: [AJUDA]ResetPlayerWeapons -
RedBulL_x - 08.12.2011
Nгo ta dando certo, fica dando e tirando as armas.
Re: [AJUDA]ResetPlayerWeapons -
lucas_mdr1235 - 08.12.2011
fail editei meu post esclui o seu e copia de novo
caso o problema persistir e pq vc nao pego as cordenadas certo ai e so vc seguir o tutorial a seguir de como pegar as cordenadas
https://sampforum.blast.hk/showthread.php?tid=164588
Respuesta: [AJUDA]ResetPlayerWeapons -
RedBulL_x - 08.12.2011
Mano as cordenada tб certa, vou postar a public inteira.
Код:
public locais(playerid)
for (new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(playerid))
{
//======================= Favela ==========================
if(IsPlayerInPlace(playerid,2016.010986, -1161.922363, 2324.010986, -923.518310))
{
DMLiberado2[playerid] = 1;
GangZoneFlashForAll(favela,0xFFFFFFAA);
GameTextForPlayer(playerid,"DM Liberado",1000,1);
GivePlayerWeapon(playerid, 24, 999);
GivePlayerWeapon(playerid, 9, 1);
GivePlayerWeapon(playerid, 25, 999);
GivePlayerWeapon(playerid, 26, 999);
GivePlayerWeapon(playerid, 30, 999);
GivePlayerWeapon(playerid, 32, 999);
}
else
{
if(DMLiberado2[playerid] == 1)
{
DMLiberado2[playerid] = 0;
GangZoneStopFlashForAll(favela);
ResetPlayerWeapons(playerid);
}
}
}
//======================= Area DM LV ==========================
if(IsPlayerInPlace(i,1267.535, 2084.409, 1408.109, 2235.263)){
DMLiberado2[i] = 1;
GangZoneFlashForAll(areadmlv,0xFFFFFFAA);
} else {
if(DMLiberado2[i] == 1){
DMLiberado2[playerid] = 0;
GangZoneStopFlashForAll(areadmlv);
}
}
//
if(PlayerToPoint(7.0, i, 70.4532,1219.1954,18.8117) || PlayerToPoint(7.0, i, -90.2719,-1169.9579,2.3964) || PlayerToPoint(7.0, i, -2411.5728,976.1896,45.4609) || PlayerToPoint(7.0, i, 2114.8413,919.9194,10.8203)){//Fort Carson
GameTextForPlayer(i,"~h~~w~Posto ~y~Petobras ~n~ Digite~r~/~r~abastecer",3000,4);
AreaPosto[i] = 1;
} else {
if(AreaPosto[i] == 1){
AreaPosto[i] = 0;
}
if (PlayerToPoint(7.0, i, 2638.9553,1107.1788,10.8203) || PlayerToPoint(7.0, i, 1595.6233,2199.6162,10.8203) || PlayerToPoint(7.0, i, 1940.8671,-1773.2283,13.3906) || PlayerToPoint(5.0, i, -2243.8435,-2560.5598,31.9219)){//Posto LV
GameTextForPlayer(i,"~h~~w~Posto ~y~Shell ~n~Digite~r~/abastecer",3000,4);
AreaPosto[i] = 1;
} else {
if(AreaPosto[i] == 1){
AreaPosto[i] = 0;
}
if (PlayerToPoint(7.0, i, 1382.3647,459.0785,20.3452) || PlayerToPoint(8.0, i, -1675.4781,413.1594,7.1797) || PlayerToPoint(7.0, i, 655.5922,-565.3943,16.3359) || PlayerToPoint(7.0, i, -1606.3616,-2713.5872,48.5335)){//Posto LS/SF
GameTextForPlayer(i,"~h~~w~Posto ~y~Ipiranga ~n~Digite~r~/abastecer",3000,4);
AreaPosto[i] = 1;
} else {
if(AreaPosto[i] == 1){
AreaPosto[i] = 0;
}
if(IsPlayerInPlace(i,576.3771, 1662.789, 619.3304, 1709.206) || PlayerToPoint(7.0, i, 1004.1403,-937.8801,42.1797) || PlayerToPoint(7.0, i, 2202.1230,2476.8582,10.8203) || PlayerToPoint(6.0, i, 417.2369,-1912.7708,1.5641)){//Posto acima FC
GameTextForPlayer(i,"~w~Posto ~y~Texaco ~n~Digite~r~/abastecer",3000,4);
AreaPosto[i] = 1;
} else {
if(AreaPosto[i] == 1){
AreaPosto[i] = 0;
}
}
}
}
}
}
Nгo й identado porque й GM MUCA.
Re: [AJUDA]ResetPlayerWeapons -
lucas_mdr1235 - 08.12.2011
tenta
PHP код:
public locais(playerid)
{
if(IsPlayerConnected(playerid))
{
//======================= Favela ==========================
if(IsPlayerInPlace(playerid,2016.010986, -1161.922363, 2324.010986, -923.518310))
{
DMLiberado2[playerid] = 1;
GangZoneFlashForAll(favela,0xFFFFFFAA);
GameTextForPlayer(playerid,"DM Liberado",1000,1);
GivePlayerWeapon(playerid, 24, 999);
GivePlayerWeapon(playerid, 9, 1);
GivePlayerWeapon(playerid, 25, 999);
GivePlayerWeapon(playerid, 26, 999);
GivePlayerWeapon(playerid, 30, 999);
GivePlayerWeapon(playerid, 32, 999);
}
else
{
if(DMLiberado2[playerid] == 1)
{
DMLiberado2[playerid] = 0;
GangZoneStopFlashForAll(favela);
ResetPlayerWeapons(playerid);
}
}
//======================= Area DM LV ==========================
if(IsPlayerInPlace(playerid,1267.535, 2084.409, 1408.109, 2235.263))
{
DMLiberado2[playerid] = 1;
GangZoneFlashForAll(areadmlv,0xFFFFFFAA);
}
else
{
if(DMLiberado2[playerid] == 1)
{
DMLiberado2[playerid] = 0;
GangZoneStopFlashForAll(areadmlv);
}
}
if(PlayerToPoint(7.0, playerid, 70.4532,1219.1954,18.8117) || PlayerToPoint(7.0, playerid, -90.2719,-1169.9579,2.3964) || PlayerToPoint(7.0, playerid, -2411.5728,976.1896,45.4609) || PlayerToPoint(7.0, playerid, 2114.8413,919.9194,10.8203))
{
GameTextForPlayer(playerid,"~h~~w~Posto ~y~Petobras ~n~ Digite~r~/~r~abastecer",3000,4);
AreaPosto[playerid] = 1;
}
else
{
if(AreaPosto[playerid] == 1)
{
AreaPosto[playerid] = 0;
}
}
if (PlayerToPoint(7.0, playerid, 2638.9553,1107.1788,10.8203) || PlayerToPoint(7.0, playerid, 1595.6233,2199.6162,10.8203) || PlayerToPoint(7.0, playerid, 1940.8671,-1773.2283,13.3906) || PlayerToPoint(5.0, playerid, -2243.8435,-2560.5598,31.9219))
{
GameTextForPlayer(playerid,"~h~~w~Posto ~y~Shell ~n~Digite~r~/abastecer",3000,4);
AreaPosto[playerid] = 1;
}
else
{
if(AreaPosto[playerid] == 1)
{
AreaPosto[playerid] = 0;
}
}
if (PlayerToPoint(7.0, playerid, 1382.3647,459.0785,20.3452) || PlayerToPoint(8.0, playerid, -1675.4781,413.1594,7.1797) || PlayerToPoint(7.0, playerid, 655.5922,-565.3943,16.3359) || PlayerToPoint(7.0, playerid, -1606.3616,-2713.5872,48.5335))
{
GameTextForPlayer(playerid,"~h~~w~Posto ~y~Ipiranga ~n~Digite~r~/abastecer",3000,4);
AreaPosto[playerid] = 1;
}
else
{
if(AreaPosto[playerid] == 1)
{
AreaPosto[playerid] = 0;
}
}
if(IsPlayerInPlace(playerid,576.3771, 1662.789, 619.3304, 1709.206) || PlayerToPoint(7.0, playerid, 1004.1403,-937.8801,42.1797) || PlayerToPoint(7.0, playerid, 2202.1230,2476.8582,10.8203) || PlayerToPoint(6.0, playerid, 417.2369,-1912.7708,1.5641))
{
GameTextForPlayer(playerid,"~w~Posto ~y~Texaco ~n~Digite~r~/abastecer",3000,4);
AreaPosto[playerid] = 1;
}
else
{
if(AreaPosto[playerid] == 1)
{
AreaPosto[playerid] = 0;
}
}
}
return 1;
}
ai se nao der e suas cordenadas mesmo ai vc segue o tutorial
https://sampforum.blast.hk/showthread.php?tid=164588
ajudei
+rep
Respuesta: [AJUDA]ResetPlayerWeapons -
RedBulL_x - 08.12.2011
Mano atй as armas que compro na Amuu Nation sгo resetadas, o que deve ser ?
Re: [AJUDA]ResetPlayerWeapons -
lucas_mdr1235 - 08.12.2011
e caraiu se tinha q ter falado antes TROLL poste sua public OnPlayerUpdate