13.12.2011, 03:20
Bueno tengo estos 2 comandos, pero en la parte que quiero que diga el nombre del jugador, no lo dice, que queda en blanco asi como "* enciende su walkitackie", espero me puedan ayudar, son los unicos comandos donde no me funciona esto, ya que el "sendername" lo tengo definido al principio del callback, por lo que sirve en todos los comandos menos en estos
pawn Код:
if(strcmp(cmd, "/sintonia", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pWalkie] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Uso: /sintonia [numero de sintonia]");
return 1;
}
new sintonia;
sintonia = strval(tmp);
if(sintonia < 0|| sintonia > 100) { SendClientMessage(playerid, COLOR_RED, "La sintonia es entre 0 y 100!"); return 1; }
if(sintonia == 0)
{
PlayerInfo[playerid][pSintonia] = 0;
format(string, sizeof(string), "* %s apaga su WalkieTakie", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
PlayerInfo[playerid][pSintonia] = sintonia;
format(string, sizeof(string), "* %s pone en sintonia su WalkieTakie", sendername, sintonia);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
return 1;
}
if(strcmp(cmd, "/walkietakie", true) == 0 || strcmp(cmd, "/wt", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pWalkie] >= 1)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[126];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "Usar: (/wt) [texto]");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Fuiste silenciado, no puedes hablar!");
return 1;
}
if(PlayerInfo[playerid][pSintonia] >= 1)
{
format(string, sizeof(string), "*** [WT] %s: %s. ***", sendername, result);
MensajeDeRadio(PlayerInfo[playerid][pSintonia], TEAM_BLUE_COLOR, string);
format(string, sizeof(string), "* %s habla por su Walkie Takie.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Usa /sintonia para poner tu radio en una sintonia");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " ЎNo tienes un Walkie Tackie!");
return 1;
}
}
return 1;
}