CMD:llamar(playerid, params[])
{
new phonenumb = strval(params);
if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "* El comando es:{A1A1A1} /llamar [nъmero]");
if(PhoneOnline[playerid] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "* Telйfono apagado.");
if(Info[playerid][pManoDer] != 68) return SendClientMessage(playerid, COLOR_GREY, "* No tienes un telйfono en tu mano derecha.");
if(Mobile[playerid] != -1) return SendClientMessageEx(playerid, COLOR_GREY, "* Cuelga la llamada en la que estбs primero");
if(Info[playerid][pJailed] >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "* Estas arrestado, no puedes utilizar tu telйfono");
if(phonenumb == Info[playerid][pPnumber]) return SendClientMessageEx(playerid, COLOR_GREY, "* No puedes llamarte a ti mismo.");
for(new i; i < MAX_PLAYERS; i++)
{
if(Info[i][pPnumber] == phonenumb)
{
if(PhoneOnline[i] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "El mуvil al que quieres llamar ya estб en una llamada.");
Mobile[playerid] = -1;
return 1;
}
if(Mobile[i] != -1)
{
SendClientMessageEx(playerid, COLOR_GREY, "El mуvil al que intentas llamar se encuentra ocupado.");
Mobile[playerid] = -1;
return 1;
}
if(Mobile[i] == -1)
{
new string[256];
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
format(string, sizeof(string), "Tu telefono estб sonando - Usa /contestar para atender la llamada. [Nъmero: %d]", Info[playerid][pPnumber]);
SendClientMessageEx(i, COLOR_GRAD1, string);
format(string, sizeof(string), "* El telйfono de %s suena.", GetPlayerNameEx(i));
SendClientMessageEx(playerid, COLOR_WHITE, "Para hablar por el telйfono escribe por el chat");
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[playerid] = 1;
Mobile[playerid] = i;
return 1;
}
}
else
{
for(new x= 0; x < 8; x++)
{
if(Info[i][pBolCant][x] == phonenumb)
{
new string[256];
format(string, sizeof(string), "Tu telefono de nъmero %d estб sonando - Sбcalo del bolsillo (/bol) y usa (/contestar). [Nъmero: %d]", phonenumb,Info[playerid][pPnumber]);
SendClientMessageEx(i, COLOR_GREY, string);
SendClientMessageEx(playerid, COLOR_WHITE, "Para hablar por el telйfono escribe por el chat");
CellTime[i] = 1;
Mobile[playerid] = i;
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "El nъmero ingresado no existe.");
return 1;
}
}
}
}
return 1;
}
new phonenumb;
if(sscanf(params, "d", phonenumb)) return SendClientMessage(playerid, -1, "Usa /llamar [numero]");
Ya te dije que debes ponerlo entre cуdigos o PHP, como quieras.
2.- No veo ningъn sscanf o de dуnde sacas el parбmetro, en otras palabras... PHP код:
|
CMD:llamar(playerid, params[])
{
new phonenumb, string[128];
if(sscanf(params, "d", phonenumb)) return SendClientMessageEx(playerid, COLOR_WHITE, "* El comando es:{A1A1A1} /llamar [nъmero]");
if(PhoneOnline[playerid] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "* Telйfono apagado.");
if(Info[playerid][pManoDer] != 6 return SendClientMessage(playerid, COLOR_GREY, "* No tienes un telйfono en tu mano derecha.");
if(Mobile[playerid] != -1) return SendClientMessageEx(playerid, COLOR_GREY, "* Cuelga la llamada en la que estбs primero");
if(Info[playerid][pJailed] >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "* Estas arrestado, no puedes utilizar tu telйfono");
if(phonenumb == Info[playerid][pPnumber]) return SendClientMessageEx(playerid, COLOR_GREY, "* No puedes llamarte a ti mismo.");
for(new i = 0; i<GetMaxPlayers();i++)
{
if(Info[i][pPnumber] == phonenumb)
{
if(PhoneOnline[i] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "El mуvil al que quieres llamar ya estб en una llamada.");
Mobile[playerid] = -1;
return 1;
}
if(Mobile[i] != -1)
{
SendClientMessageEx(playerid, COLOR_GREY, "El mуvil al que intentas llamar se encuentra ocupado.");
Mobile[playerid] = -1;
return 1;
}
if(Mobile[i] == -1)
{
new string[256];
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
format(string, sizeof(string), "Tu telefono estб sonando - Usa /contestar para atender la llamada. [Nъmero: %d]", Info[playerid][pPnumber]);
SendClientMessageEx(i, COLOR_GRAD1, string);
format(string, sizeof(string), "* El telйfono de %s suena.", GetPlayerNameEx(i));
SendClientMessageEx(playerid, COLOR_WHITE, "Para hablar por el telйfono escribe por el chat");
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
CellTime[playerid] = 1;
Mobile[playerid] = i;
return 1;
}
}
}
return 1;
}