01.10.2014, 22:57
Hola intente pasar este comando a cmd:
Dejo el original y el mio
Original
Pasado
Errores:
Linea 1198:
1199:
Dejo el original y el mio
Original
pawn Код:
if(strcmp(cmd, "/y", true) == 0 || strcmp(cmd, "/me", true) == 0){
if(IsPlayerConnected(playerid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')){
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))){
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)){
SendClientMessage(playerid, COLOR_YELLOW, "/y [accion]");
return 1;
}
new jugador[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, jugador, sizeof(jugador));
if(PlayerInfo[playerid][IUSER] >= 0){
format(string, sizeof(string), "* %s %s", jugador, result);
}
ProxDetector(30.0, playerid, string, Rol,Rol,Rol,Rol,Rol);
printf("%s", string);
}
return 1;
}
pawn Код:
CMD:y(playerid, params[])return cmd_me(playerid, params);
CMD:me(playerid, params[])
{
if(IsPlayerConnected(playerid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')){
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))){
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)){
SendClientMessage(playerid, COLOR_YELLOW, "/y [accion]");
return 1;
}
new jugador[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, jugador, sizeof(jugador));
if(PlayerInfo[playerid][IUSER] >= 0){
format(string, sizeof(string), "* %s %s", jugador, result);
}
ProxDetector(30.0, playerid, string, Rol,Rol,Rol,Rol,Rol);
printf("%s", string);
}
return 1;
}
Код:
C:\Users\AsusEvo\Desktop\GM_Base\gamemodes\Mio.pwn(1198) : error 017: undefined symbol "cmdtext" C:\Users\AsusEvo\Desktop\GM_Base\gamemodes\Mio.pwn(1199) : error 017: undefined symbol "idx" C:\Users\AsusEvo\Desktop\GM_Base\gamemodes\Mio.pwn(1199) : error 029: invalid expression, assumed zero C:\Users\AsusEvo\Desktop\GM_Base\gamemodes\Mio.pwn(1199) : error 029: invalid expression, assumed zero C:\Users\AsusEvo\Desktop\GM_Base\gamemodes\Mio.pwn(1199) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
pawn Код:
new length = strlen(cmdtext);
pawn Код:
while ((idx < length) && (cmdtext[idx] <= ' ')){