SA-MP Forums Archive
[Ajuda] desalgemar bugado - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] desalgemar bugado (/showthread.php?tid=583643)



desalgemar bugado - Matei123 - 29.07.2015

Bem Pessoal Venho Aki Pedir Mais Uma Ajudinha Para vcs !

Tipo pessoal quando do /desalgemar o cara continuar parado e nгo se meche fica paradгo

ai meus codico

PHP код:
if(strcmp(cmd, "/desalgemar", true) == 0) {
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(
dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1){
new 
tmp[256];
new 
plid;
tmp = strtok(cmdtext, idx);
if(!
strlen(tmp)){
SendClientMessage(playerid, Vermelho, "/desalgemar [id]");
return 
1;
}
plid = strval(tmp);
if(
plid == playerid){
SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
return 
1 ;
}
if(!
IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado");
return 
1;
} else {
if(
GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname);
GameTextForPlayer(plid,"~w~Desalgemado", 25000, 3);
SendClientMessage(plid, 0x8C8CFFAA, string);
SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso.");
algemado[plid] = 0;
return 
1;
} else {
SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar.");
return 
1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
return 
1;
}
} 



Re: desalgemar bugado - Cleyson - 29.07.2015

TogglePlayerControllable

PHP код:
TogglePlayerControllable(plid, 1); 



Re: desalgemar bugado - Matei123 - 29.07.2015

deu esses erro
Quote:

C:\Users\alexandre\Desktop\gm\Brasil Vida Real\gm be\gm\gamemodes\EXPRPG.pwn(4944) : error 017: undefined symbol "plid"




Re: desalgemar bugado - Cleyson - 29.07.2015

PHP код:
if(strcmp(cmd, "/desalgemar", true) == 0) { 
new 
aname[MAX_PLAYER_NAME]; 
GetPlayerName(playerid, aname, MAX_PLAYER_NAME); 
format(file, sizeof(file), PASTA_CONTAS, aname); 
if(
dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1){ 
new 
tmp[256]; 
new 
plid; 
tmp = strtok(cmdtext, idx); 
if(!
strlen(tmp)){ 
SendClientMessage(playerid, Vermelho, "/desalgemar [id]"); 
return 
1; 
} 
plid = strval(tmp); 
if(
plid == playerid){ 
SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo."); 
return 
1 ; 
} 
if(!
IsPlayerConnected(plid)){ 
SendClientMessage(playerid, Vermelho, "O jogador nгo estб conectado"); 
return 
1; 
} else { 
if(
GetDistanceBetweenPlayers(plid,playerid) < 10){ 
format(string, sizeof(string), "(INFO) O jogador %s te desalgemou.", aname); 
GameTextForPlayer(plid,"~w~Desalgemado", 25000, 3); 
SendClientMessage(plid, 0x8C8CFFAA, string); 
SendClientMessage(playerid, 0x8C8CFFAA, "(INFO) Desalgemado com sucesso."); 
TogglePlayerControllable(plid, 1);
algemado[plid] = 0; 
return 
1; 
} else { 
SendClientMessage(playerid,Vermelho," Chegue mais perto para desalgemar."); 
return 
1; 
} 
} 
} else { 
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!"); 
return 
1; 
} 
} 
O posicionamento da funзгo deve estar em lуgica.

Usa a cabeзa, pense um pouco !


Re: desalgemar bugado - Matei123 - 30.07.2015

Problema Resolvido Brigadгo ai