Player id 3: no funciona
#1

Bueno, ya hice un topic de estos. Pero no me dan ayuda + necesito una respuesta rapido

Bueno,

Por ejemplo, tengo estas 2 cmds:

pawn Код:
CMD:burn(playerid,params[])
{
    if(GetPVarInt(playerid, "Level") >= 3)
    {
        new
            ID,
            Float:X,
            Float:Y,
            Float:Z;
        if(unformat(params,"r", ID)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /Burn <PlayerID>");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");
        GetPlayerPos(ID, X, Y, Z);
        SendFMessage(ID, COLOR_LIGHTBLUE, "Admin: %s(%d) has burnt you!", pName(playerid), playerid);
        return CreateExplosion(X, Y, Z + 3, 1, 10);
    }
    else return AdminCmd(playerid, 3);
}
pawn Код:
CMD:pm(playerid, params[])
{
    new pID;
    if(sscanf(params, "rs[128]", pID, params)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");

    SendFMessage(pID, COLOR_PEACHPUFF, "PM From: %s(%d) - %s", pName(playerid), playerid, params);
    SendFMessage(playerid, COLOR_PEACHPUFF, "PM Sent To: %s(%d) - %s", pName(pID), pID, params);
    return 1;
}
Cuando use /PM 3 blablabla, me dice q el no esta conectado. Pero si esta. Funciona asta : /PM 2 blabla

Lo mismo con la cmd de /burn

---
Porfa, necesito respuesta rapido
---
o, Zamaroth me dijo q utilizara printf()

Lo utilitize, i cuando vi los resultados, es como el playerid no esta correcto. miren:

Uso la cmd /pm 1 blabla, el print dice, player id: 1

Uso la cmd otra ves ( enseguida de la 1mera ves ) i el print dice: player id: 0 -- Pero use /pm 1 blabla

Lo q me pregunto, por q dice: Player id: 0? cuando use /pm 1 blabla

Sera usando "r" ? seria "u"?

Porfavor, necesito una respuesta inmediatamente!
Reply
#2

Que yo sepa "r" no existe, intentб con "u" que es NombreDelJugador/ID
Reply
#3

usa iS()[128]
Reply
#4

aca te dejo mi PM o MP haci te ayudas

Код:
CMD:mp(playerid, params[])
{
	new id;
	new mensaje[132];
    {
    if(sscanf(params, "iS()[132]", id, mensaje))
    {
    SendClientMessage(playerid,COLOR_GRIS,"[MP] /mp <playerid> [mensaje]");
    return 1;
    } else {
    if (id < 0 || id > GetMaxPlayers())
    {
	SendClientMessage(playerid,COLOR_GRIS,"[MP] ID invalida");
	return 1;
	}
	if(!IsPlayerConnected(id))
	{
	SendClientMessage(playerid,COLOR_GRIS,"[MP] El jugador no esta conectado");
	return 1;
	}
    if (id == playerid)
    {
    SendClientMessage(playerid, 0xFF0000FF, "[PM] No puedes enviarte un PM a ti mismo");
	return 1;
    }
	new string[128];
	new string2[128];
	new emisor[MAX_PLAYER_NAME];
	new receptor[MAX_PLAYER_NAME];
	GetPlayerName(playerid,emisor,sizeof(emisor));
	GetPlayerName(id,receptor,sizeof(receptor));
	format(string,sizeof(string),"[MP] %s [ID:%i]: %s",emisor,playerid,mensaje);
	format(string2,sizeof(string),"[MP] Mensaje enviado a %s",receptor);
    SendClientMessage(id,COLOR_AMARILLO,string);
    SendClientMessage(playerid,COLOR_AMARILLO,string2);
	}
    }
	return 1;
}
Reply
#5

no creo q entiendes el problema. No importa cualquier cmd q use, ( q tenga extra parametro , Ejemplo: /slap <playerid>, /burn < playerid>, /kick < playerid>) Si uso unas de esas cmds con /Kick 3, no funciona.

Nomas puedo usar las cmds asta playerid 2
Reply
#6

que raro a y si entendi por eso te di ese comando para que probaras aver intenta haci:

Код:
CMD:pm(playerid, params[])
{
    new pID;
    if(sscanf(params, "iS()[128]", pID, params)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");

    SendFMessage(pID, COLOR_PEACHPUFF, "PM From: %s(%d) - %s", pName(playerid), playerid, params);
    SendFMessage(playerid, COLOR_PEACHPUFF, "PM Sent To: %s(%d) - %s", pName(pID), pID, params);
    return 1;
}
SALU2

EDIT:creo que es eso probe con rs y me dice ID invalida proba con iS()[128]
avisame si te funciona
Reply
#7

Quote:
Originally Posted by Ari3l
Посмотреть сообщение
que raro a y si entendi por eso te di ese comando para que probaras aver intenta haci:

Код:
CMD:pm(playerid, params[])
{
    new pID;
    if(sscanf(params, "iS()[128]", pID, params)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");

    SendFMessage(pID, COLOR_PEACHPUFF, "PM From: %s(%d) - %s", pName(playerid), playerid, params);
    SendFMessage(playerid, COLOR_PEACHPUFF, "PM Sent To: %s(%d) - %s", pName(pID), pID, params);
    return 1;
}
SALU2

EDIT:creo que es eso probe con rs y me dice ID invalida proba con iS()[128]
avisame si te funciona
iS()[128] es para un nъmero (Id del jugador) y un string opcional, en un PM el mensaje NO es opcional.


Lethal, їprobaste con usar 'u' en vez de 'r'?
Reply
#8

Muchas gracias por las respuestas!

Funciono con 'u'. Pero todavia me pregunto por q no funciono con 'r' :/

--------
Gracias!
Reply
#9

Creo que 'r' no existe xD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)