18.02.2012, 22:52
й Possivel dar nivel de procurado a todos os players que estiverem proximos ao lugar do roubo ? tipo roubar a loterica , ai todos que estгo proximos ao cofre recebem nivel de proc ?
new a = 0, b = GetMaxPlayers();
for( ; a != b; ++a ) {
if(IsPlayerInRangeOfPoint(a, 15.0, roubox, rouboy, rouboz)) {
//
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 20, X, Y, Z)) //Local do roubo
{
new string[3] = GetPlayerWantedLevel(i);
SetPlayerWantedLevel(i, string+1);
}
}
pawn Код:
|
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : error 008: must be a constant expression; assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45275) : error 033: array must be indexed (variable "string")
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45276) : error 033: array must be indexed (variable "string")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
if(strcmp(cmd, "/fugir", true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972)) //Local do roubo
{
new string[3] = GetPlayerWantedLevel(i);
SetPlayerWantedLevel(i, string+1);
SetPlayerWantedLevel(i, string+1);
PlayerInfo[i][pJailed] = 0;
PlayerInfo[giveplayerid][pJailTime] = 0;
GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);
format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);
BroadCast(COLOR_OOC,string);
}
}
return 1;
}
if(strcmp(cmd, "/fugir", true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972))
{
new string[3] = GetPlayerWantedLevel(i);
SetPlayerWantedLevel(i, string+1);
SetPlayerWantedLevel(i, string+1);
PlayerInfo[i][pJailed] = 0;
PlayerInfo[giveplayerid][pJailTime] = 0;
SetPlayerCriminal(playerid,255, "Pega ***** Mlq Pilota");//Pra da nivel de procurado
GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);
format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);
BroadCast(COLOR_OOC,string);
}
}
return 1;
}
Tenta pra ver se da certo aii, deixa como tava sem ERRO e troca por isso : pawn Код:
Ajudei ? +Reputa... |
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : error 008: must be a constant expression; assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45275) : error 033: array must be indexed (variable "string")
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45276) : error 033: array must be indexed (variable "string")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
if(strcmp(cmd, "/fugir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972))
{
PlayerInfo[i][pJailed] = 0;//Pra Tirar o Tempo
PlayerInfo[giveplayerid][pJailTime] = 1;//Deixa assim
SetPlayerCriminal(playerid,255, "Pega ***** Mlq Pilota");//Pra da nivel de procurado
GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);//Messagem de Fuga
format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);//Messagem pra todos sobre fuga '-'
BroadCast(COLOR_OOC,string);
}
}
return 1;
}