como hacer un comando
+2
Ronald
dipli
6 participantes
Página 1 de 1.
como hacer un comando
miren kiero hacer un comando de conteo osea q cuando ponga /conteo salga en la pantalla los numeros empesando del 5 y termine en cero
por ejemplo /conteo has iniciado conteo 5 4 3 2 1 go o corre no c
y otro q sea para el admin kiero poner un /rcon como el say pero q en ves q aparesca en el chat admin que salga en la pantalla de los jugadores
si me explico por favor ayudenme pliz!!!
por ejemplo /conteo has iniciado conteo 5 4 3 2 1 go o corre no c
y otro q sea para el admin kiero poner un /rcon como el say pero q en ves q aparesca en el chat admin que salga en la pantalla de los jugadores
si me explico por favor ayudenme pliz!!!
dipli- Leecher
- Cantidad de envíos : 26
Puntos diversión latina. : 1
Fecha de inscripción : 10/05/2009
Re: como hacer un comando
mira mas abajo hay esta todo pero almenos saluda XD no importa salu2
Invitado- Invitado
Re: como hacer un comando
perdon por no saludar jajaa
el comando de admin ya lo encontre y el de conteo ese si no
ni c como hacerlo jaja
bueno gracias
saludos
el comando de admin ya lo encontre y el de conteo ese si no
ni c como hacerlo jaja
bueno gracias
saludos
dipli- Leecher
- Cantidad de envíos : 26
Puntos diversión latina. : 1
Fecha de inscripción : 10/05/2009
Re: como hacer un comando
aaa se me olvido decirte man amigo necesito ayuda con el ladmin4v2 cuando se registran el ladmin4v2 les de el nivel 10 de admin osea porq me pasa eso kiero q me ayudes a ver si esta mal configurado o no c q le pase me ayudas pofavor
saludines:) gracias por tu ayuda
saludines:) gracias por tu ayuda
dipli- Leecher
- Cantidad de envíos : 26
Puntos diversión latina. : 1
Fecha de inscripción : 10/05/2009
Re: como hacer un comando
- Código:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("n----------------------------------------");
print(" Tu nombre aqui");
print("----------------------------------------n");
return 1;
}
#else
#endif
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_PINK 0xFF00FFAA
#define FREEZEZONE 15 //Cambia esto para cambio el radio del FREEZE! (default 15)
forward countdown();
new Float:X, Float:Y, Float:Z, Float:X2, Float:Y2, Float:Z2, CountStage = 0, timer, Float:dist;
new pName[MAX_PLAYER_NAME], string[25 + MAX_PLAYER_NAME], Frozen[MAX_PLAYERS];
new Freeze = 0, Locality = 1;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/count",true) == 0)
{
if(CountStage ==0)
{
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "*** %s Comenzo una cuenta regresiva.", pName);
timer = SetTimer("countdown",1000,1);
CountStage = 3;
if(Locality == 1)
{
GetPlayerPos(playerid, X, Y, Z);
for(new i; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, X2, Y2, Z2);
dist = Distance(X, Y, Z, X2, Y2, Z2);
if(dist <= FREEZEZONE)
{
SendClientMessage(i, COLOR_PINK, string);
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
if(Freeze == 1)
{
Frozen[i] = 1;
TogglePlayerControllable(i,0);
}
else Frozen[i] = 2;
}
}
}
else if(Locality == 0)
{
SendClientMessageToAll(COLOR_PINK, string);
GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
if(Freeze == 1) ToggleAllControllable(0);
}
}
else SendClientMessage(playerid, COLOR_PINK, "El countdown esta ocupado!");
return 1;
}
if (strcmp("/toglocal", cmdtext, true, 7) == 0)
{
if(CountStage == 0)
{
if(Locality == 0) Locality = 1, SendClientMessage(playerid, COLOR_PINK, "Locality now ON!");
else Locality = 0, SendClientMessage(playerid, COLOR_PINK, "Locality now OFF!");
}
else GameTextForPlayer(playerid, "Espera un cuntdown esta en progreso", 3000, 3);
return 1;
}
if (strcmp("/togfreeze", cmdtext, true, 10) == 0)
{
if(CountStage == 0)
{
if(Freeze == 0) Freeze = 1, SendClientMessage(playerid, COLOR_PINK, "Freeze now ON!");
else Freeze = 0, SendClientMessage(playerid, COLOR_PINK, "Freeze now OFF!");
}
else GameTextForPlayer(playerid, "Porfavor espera un countdown esta en progreso", 3000, 3);
return 1;
}
return 0;
}
public countdown()
{
if(Locality == 0)
{
switch(CountStage)
{
case 1:
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~¡START!~g~-~y~]~g~-",1000,3);
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] == 1) TogglePlayerControllable(i, 1), Frozen[i] = 0;
else if(Frozen[i] == 2) Frozen[i] = 0;
GetPlayerPos(i,X,Y,Z);
PlayerPlaySound(i,1057,X,Y,Z);
}
KillTimer(timer);
CountStage = 0;
}
case 2: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3), CountStage = 1;
case 3: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3), CountStage = 2;
}
}
if(Locality == 1)
{
switch(CountStage)
{
case 1:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0)
{
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~START~g~-~y~]~g~-",1000,3);
if(Frozen[i] == 1) TogglePlayerControllable(i, 1);
Frozen[i] = 0;
GetPlayerPos(i,X,Y,Z);
PlayerPlaySound(i,1057,X,Y,Z);
}
}
KillTimer(timer);
CountStage = 0;
}
case 2:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0) GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3);
}
CountStage = 1;
}
case 3:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0) GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3);
}
CountStage = 2;
}
}
}
}
stock Distance(Float:a, Float:b, Float:c, Float:d, Float:e, Float:f)
{
dist = floatsqroot(floatpower((a - d),2)+floatpower((b - e),2)+floatpower((c - f),2));
return floatround(dist);
}
stock ToggleAllControllable(onoff)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Freeze == 1 && onoff == 0) Frozen[i] = 1;
else if(Freeze == 0 && onoff == 0) Frozen[i] = 2;
else if(onoff == 1) Frozen[i] = 0;
TogglePlayerControllable(i,onoff);
}
}
Espero que te sirva
maury- Leecher
- Cantidad de envíos : 9
Puntos diversión latina. : 0
Fecha de inscripción : 06/07/2009
Re: como hacer un comando
xD, yo lo sabía si alguna vez lo enncuentro te lo digo :p
Chaca- Miembro premium
- Cantidad de envíos : 101
Puntos diversión latina. : 6
Fecha de inscripción : 18/07/2009
Re: como hacer un comando
maury escribió:
- Código:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("n----------------------------------------");
print(" Tu nombre aqui");
print("----------------------------------------n");
return 1;
}
#else
#endif
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_PINK 0xFF00FFAA
#define FREEZEZONE 15 //Cambia esto para cambio el radio del FREEZE! (default 15)
forward countdown();
new Float:X, Float:Y, Float:Z, Float:X2, Float:Y2, Float:Z2, CountStage = 0, timer, Float:dist;
new pName[MAX_PLAYER_NAME], string[25 + MAX_PLAYER_NAME], Frozen[MAX_PLAYERS];
new Freeze = 0, Locality = 1;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/count",true) == 0)
{
if(CountStage ==0)
{
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "*** %s Comenzo una cuenta regresiva.", pName);
timer = SetTimer("countdown",1000,1);
CountStage = 3;
if(Locality == 1)
{
GetPlayerPos(playerid, X, Y, Z);
for(new i; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, X2, Y2, Z2);
dist = Distance(X, Y, Z, X2, Y2, Z2);
if(dist <= FREEZEZONE)
{
SendClientMessage(i, COLOR_PINK, string);
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
if(Freeze == 1)
{
Frozen[i] = 1;
TogglePlayerControllable(i,0);
}
else Frozen[i] = 2;
}
}
}
else if(Locality == 0)
{
SendClientMessageToAll(COLOR_PINK, string);
GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
if(Freeze == 1) ToggleAllControllable(0);
}
}
else SendClientMessage(playerid, COLOR_PINK, "El countdown esta ocupado!");
return 1;
}
if (strcmp("/toglocal", cmdtext, true, 7) == 0)
{
if(CountStage == 0)
{
if(Locality == 0) Locality = 1, SendClientMessage(playerid, COLOR_PINK, "Locality now ON!");
else Locality = 0, SendClientMessage(playerid, COLOR_PINK, "Locality now OFF!");
}
else GameTextForPlayer(playerid, "Espera un cuntdown esta en progreso", 3000, 3);
return 1;
}
if (strcmp("/togfreeze", cmdtext, true, 10) == 0)
{
if(CountStage == 0)
{
if(Freeze == 0) Freeze = 1, SendClientMessage(playerid, COLOR_PINK, "Freeze now ON!");
else Freeze = 0, SendClientMessage(playerid, COLOR_PINK, "Freeze now OFF!");
}
else GameTextForPlayer(playerid, "Porfavor espera un countdown esta en progreso", 3000, 3);
return 1;
}
return 0;
}
public countdown()
{
if(Locality == 0)
{
switch(CountStage)
{
case 1:
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~¡START!~g~-~y~]~g~-",1000,3);
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] == 1) TogglePlayerControllable(i, 1), Frozen[i] = 0;
else if(Frozen[i] == 2) Frozen[i] = 0;
GetPlayerPos(i,X,Y,Z);
PlayerPlaySound(i,1057,X,Y,Z);
}
KillTimer(timer);
CountStage = 0;
}
case 2: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3), CountStage = 1;
case 3: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3), CountStage = 2;
}
}
if(Locality == 1)
{
switch(CountStage)
{
case 1:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0)
{
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~START~g~-~y~]~g~-",1000,3);
if(Frozen[i] == 1) TogglePlayerControllable(i, 1);
Frozen[i] = 0;
GetPlayerPos(i,X,Y,Z);
PlayerPlaySound(i,1057,X,Y,Z);
}
}
KillTimer(timer);
CountStage = 0;
}
case 2:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0) GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3);
}
CountStage = 1;
}
case 3:
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Frozen[i] != 0) GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3);
}
CountStage = 2;
}
}
}
}
stock Distance(Float:a, Float:b, Float:c, Float:d, Float:e, Float:f)
{
dist = floatsqroot(floatpower((a - d),2)+floatpower((b - e),2)+floatpower((c - f),2));
return floatround(dist);
}
stock ToggleAllControllable(onoff)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Freeze == 1 && onoff == 0) Frozen[i] = 1;
else if(Freeze == 0 && onoff == 0) Frozen[i] = 2;
else if(onoff == 1) Frozen[i] = 0;
TogglePlayerControllable(i,onoff);
}
}
Espero que te sirva
Me tiro cantidad de errores el codigo., de todas formas se agradece.
Size_Locote- Miembro de oro
- Cantidad de envíos : 51
Edad : 30
Puntos diversión latina. : 5
Fecha de inscripción : 10/08/2009
Temas similares
» [Ayuda]Como hacer admin?
» Pasa Comando Comun a Comando Rcon
» [Peticion]El comando /drag de RPG
» como hacer otro usuario admin de mi server samp
» Pasa Comando Comun a Comando Rcon
» [Peticion]El comando /drag de RPG
» como hacer otro usuario admin de mi server samp
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.
|
|