Comando script ayuda -
SAMPGammer - 27.10.2010
Quiero hacer una cosa que por ejemplo sea /decir 444
y salga en el centro de la pantalla 444 porfa AYUDARME gRACIAS
Re: Comando script ayuda -
SuperMarioRol - 27.10.2010
Comando del Rp /cnn o /cnnn
Si lo quieres para NO RP avisa
pawn Код:
if(strcmp(cmd, "/cnn", true) == 0) // Moddded By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 4) //Admin
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cnn [cnn textformat ~n~=Newline ~r~=Red ~g~=Green ~b~=Blue ~w~=White ~y~=Yellow]"); //Si no introduces tods los datos...
return 1;
}
format(string, sizeof(string), "[ADMIN]: %s Has CNN'd [%s]", sendername , result);
ABroadCast(COLOR_LIGHTRED,string, 5); //Avisa a los admins del comando
format(string,sizeof(string),"%s",(result));
GameTextForAll(string,5000,6); //Manda el texto
/*new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has CNN'd: [%s]",d,m,y,h,mi,s,sendername,result);
AnnounceLog(string); No se usa, solo para Cierto GM de RP*/
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** you are not authorized to use that command!"); //Si no eres admin...
return 1;
}
}
return 1;
}
Es un comando mas completo de lo habitual, pero estб en strcmp que te sera mas facil copiarlo y pegarlo
Re: Comando script ayuda -
SAMPGammer - 27.10.2010
funca en grandlarc? es el gamemode que tengo

que ponga /texto ASDASA y salga asґASDASA
Re: Comando script ayuda -
SuperMarioRol - 28.10.2010
No, luego te lo edito o te paso uno con DCMD
Re: Comando script ayuda -
SAMPGammer - 28.10.2010
Va, porfa, te lo agredecerнa MUCHO

!
Re: Comando script ayuda -
CristianTdj - 28.10.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/decir", true))
{
new tmp[256] = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xffffffff, "* Usa: /decir <texto>.");
GameTextForAll(strlen(tmp), tiempo, estilo);
return 1;
}
return 0;
}
Respuesta: Re: Comando script ayuda -
MrDeath537 - 28.10.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/decir", true, 6))
{
GameTextForAll(cmdtext[7], tiempo, estilo);
return 1;
}
return 0;
}
Creo que ahн estб bien XD, pero se le podrнan agregar un monton de cosas a eso
Re: Comando script ayuda -
SuperMarioRol - 28.10.2010
Wii~
Gracias Cristian, ni me acordaba xD
Re: Comando script ayuda -
SAMPGammer - 29.10.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/decir", true, 6))
{
GameTextForAll(cmdtext[7], tiempo, estilo);
return 1;
}
return 0;
}
їComo se usa?
EDIT: C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(93) : error 017: undefined symbol "strtok"
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(93) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(97) : error 017: undefined symbol "tiempo"
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(92) : warning 203: symbol is never used: "idx"
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(92 -- 103) : warning 225: unreachable code
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(92 -- 103) : warning 217: loose indentation
C:\Documents and Settings\------Escritorio\server\pawno\texto.pwn(103) : error 029: invalid expression, assumed zero
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(103) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Documents and Settings\------\Escritorio\server\pawno\texto.pwn(103) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
Respuesta: Comando script ayuda -
TheChaoz - 29.10.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]){
if(strcmp(cmdtext, "/decir", true, 6) == 0){
if(IsPlayerAdmin(playerid))return GameTextForAll(cmdtext[7], tiempo, estilo);
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Debes ser admin rcon para usar este comando");
}
return 0;
}
espero q t sirva