[AJUDA]Prisгo Especial -
dPlaYer_ - 07.07.2011
Sou Novo na Area Panwo e to aprendendo ainda a criar cmd's.. + Ja sei o basico ;p
Meu GM EH o Do Brazillian Rpg..
TiPo o comando q eu fiz eh esse '-' Peguei do cmd /prender e Editei e vai normal .. so quero aumentar o tempo!
Код:
if(strcmp(cmd, "/prisaoe", true) == 0) {
if(prendeu[playerid] == 1) return SendClientMessage(playerid, Vermelho, "Aguarde Um Pouco Para prender Novamente");
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "/prisaoe [id]");
return 1;
}
plid = strval(tmp);
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
format(string, sizeof(string), "O Admin %s te colocou na Solitбria Por 5 Minutos.", aname);
SendClientMessage(plid, Blue, string);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
SendClientMessage(playerid, 0x8C8CFFAA, "(AdmiCMD) Preso com sucesso.");
prendeu[playerid] = 1;
preso[plid] = 1;
TogglePlayerControllable(plid, 1);
return 1;
} else {
SendClientMessage(playerid,Vermelho," Chegue mais perto para Prender!");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho," Apenas Admins Podem Fazer Isto!");
return 1;
}
}
Re: [AJUDA]Prisгo Especial -
RockFire - 07.07.2011
Й aham, claro que sabe o bбsico, qualquer um que sabe o bбsico sabe isso...
SII + ZCMD + SSCANF
PHP код:
new Float:PrisaoPos[] = { 0.0,0.0,0.0 },Prisao[2];
CMD:bangu(playerid,params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo й administrador");
new v[2];
if(sscanf(params,"ui",v[0],v[1])) return SendClientMessage(playerid,-1,"/bangu id tempo");
if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
SetPlayerPos(v[0],PrisaoPos[0],PrisaoPos[1],PrisaoPos[2]); // Posiзгo da prisгo
if(INI_Open("presos.ini")) {
new n[24];
GetPlayerName(playerid,n,sizeof(n));
INI_WriteInt(n,v[1]);
INI_Close();
}
return true;
}
public OnPlayerSpawn(playerid) {
if(INI_Open("presos.ini")) {
new n[24];
GetPlayerName(playerid,n,sizeof(n));
new Prisao[0] = INI_ReadInt(n);
if(INI_ReadInt(n)) {
SetPlayerPos(playerid,PrisaoPos[0],PrisaoPos[1],PrisaoPos[2]);
SendClientMessage(playerid,-1,"Nгo pode escapar saindo do jogo...");
Prisao[1] = SetTimerEx("TimerPreso",1000,true,"i",playerid);
}
INI_Close();
}
return true;
}
forward TimerPreso(playerid);
public TimerPreso(playerid) {
Prisao[0]--;
if(Prisao[0] == 0) {
GameTextForPlayer(playerid,"Solto",1000,3);
SpawnPlayer(playerid);
KillTimer(Prisao[1]);
if(INI_Open("presos.ini")) {
new n[24];
GetPlayerName(playerid,n,sizeof(n));
INI_RemoveEntry(n);
INI_Close();
}
}
else {
new t[30];
format(t,sizeof(t),"Tempo %i",Prisao[0]);
GameTextForPlayer(playerid,t,1000,3);
}
return true.
}
Re: [AJUDA]Prisгo Especial -
Macintosh - 07.07.2011
Faz um settimer com o preso.
Re: [AJUDA]Prisгo Especial -
dPlaYer_ - 07.07.2011
Ok Vlw's ae gente consegui ;p