[Ajuda] Congelar.. - 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] Congelar.. (
/showthread.php?tid=586296)
Congelar.. -
LuisFerreira - 21.08.2015
Bom eu posso estar fazendo errado, mais nao esta funcionando o motivo, e ali quando ele ta ja ta congelado, era pra avisar e nгo alternar o tempo, e o tempo muda -.-.
PHP код:
CMD:congelar(playerid, params[])
{
new name[24];
GetPlayerName(playerid, name, sizeof(name));
new targetid, Motivo[50];
if(IsPlayerAdmin(playerid)){
if (sscanf(params, "ui", targetid, Time[targetid], Motivo)) return SendClientMessage(playerid, -1, "{FF0000}Usar: /Congelar [ID/Name] [Segundos] [Motivo]");
if(freeze[targetid]==1)
return SendClientMessage(playerid, -1, "O jogador jб estб congelado!"), false;
else{
TogglePlayerControllable(playerid,0);
format(str3,sizeof(str3)," Congelado pelo administrador:%s, por %i segundos, Motivo: %s",name, Time[targetid], Motivo);
SendClientMessage(targetid, 0xB60000A4, str3);
freeze[targetid]=1;
}
}
else
{
SendClientMessage(playerid, 0xE0EDF4FF, "Sem permissao");
}
return 1;
Re: Congelar.. -
IgorLuiz - 21.08.2015
Tenta ae
PHP код:
CMD:congelar(playerid, params[])
{
new name[24];
GetPlayerName(playerid, name, sizeof(name));
new targetid, Motivo[50];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "uis", targetid, Time[targetid], Motivo)) return SendClientMessage(playerid, -1, "{FF0000}Usar: /Congelar [ID/Name] [Segundos] [Motivo]");
if(freeze[targetid] == 1) return SendClientMessage(playerid, -1, "O jogador jб estб congelado!");
TogglePlayerControllable(targetid, 0);
format(str3,sizeof(str3)," Congelado pelo administrador:%s, por %i segundos, Motivo: %s",name, Time[targetid], Motivo);
SendClientMessage(targetid, 0xB60000A4, str3);
freeze[targetid] = 1;
}
else
{
SendClientMessage(playerid, 0xE0EDF4FF, "Sem permissao");
}
return 1;
}
Re: Congelar.. -
RafaelOsio - 21.08.2015
Estou no celular, entгo nгo poderei ajudar muito bem, mas o problema estб ali no sscanf. Vocк colocou apenas "ui" nos parвmetros, sendo que o certo seria "uis", pois ainda tem a string do motivo. Nгo sei se apenas isso resolve, como disse, estou no celular.