Ayuda comando w
#1

Tengo serios problemas con devolver el nombre de una funcion

Alguien me ayuda?

pawn Код:
zcmd(w, playerid, params[])
    {
        if(!sscanf(params, "us[128]", params[0], params[1]))
        {
            if(params[0] != INVALID_PLAYER_ID)
            {
                if(Info[playerid][pAdminZC] > 0 || Info[playerid][pAdminZC] == 0 && Info[params[0]][pAdminZC] > 0)
                {
                    if(HidePM[params[0]] == 1 && Info[playerid][pAdminZC] < 999999) return SendClientMessageEx(playerid, COLOR_GRAD2, "Este administrador/ayudante tiene los susurros bloqueados!");
                    new string[128];
                    format(string, sizeof(string), "Mensaje de %s (%d): %s", PlayerName(playerid), playerid, params[1]);
                    SendClientMessageEx(params[0], 0xE9BC0AFF, string);
                    format(string, sizeof(string), "Susurras a %s (%d): %s", PlayerName(params[0]), params[0] ,params[1]);
                    SendClientMessageEx(playerid,  0xE9BC0AFF, string);
                    if(Info[playerid][pAdminZC] != 99999)
                    {
                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if(Info[i][pAdminZC] >= 99999)
                            {
                                if(See_MP[i] == 1)
                                {
                                    format(string, sizeof(string), ":MP: %s(%d) a %s(%d): %s", PlayerName(playerid), playerid, PlayerName(params[0]), params[0], params[1]);
                                    SendClientMessageEx(i, 0xFF8000FF, string);
                                }
                            }
                        }
                    }
                }
                else SendClientMessageEx(playerid, COLOR_GRAD2, "ЎSusurros solo ha administradores!");
            }
            else SendClientMessageEx(playerid, COLOR_GRAD2, "Jugador no conectado.");
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Utilize: /w <PlayerID> <Texto>");
        return 1;
    }
que tiene de malo lo que pasa es que uso el comando y no me dice el nombre solo me dice una letra.

de paso me dejan un tuto de como usar esta funcion gracias
Reply
#2

Код:
    zcmd(w, playerid, params[])
    {
        if(!sscanf(params, "us[128]", params[0], params[1]))
        {
            if(params[0] != INVALID_PLAYER_ID)
    		{
	      		if(PlayerInfo[playerid][pAdminCP] > 0 || PlayerInfo[playerid][pAdminCP] == 0 && PlayerInfo[params[0]][pAdminCP] > 0)
	        	{
	         		if(HidePM[params[0]] == 1 && PlayerInfo[playerid][pAdminCP] < 2013) return Message(playerid, COLOR_GRAD2, "Este administrador/ayudante tiene los susurros bloqueados!");
	         		new string[128];
					format(string, sizeof(string), "Mensaje de %s (%d): %s", PlayerName(playerid), playerid, params[1]);
					Message(params[0], 0xE9BC0AFF, string);
					format(string, sizeof(string), "Susurras a %s (%d): %s", PlayerName(params[0]), params[0] ,params[1]);
					Message(playerid,  0xE9BC0AFF, string);
					if(PlayerInfo[playerid][pAdminCP] != 2014 && PlayerInfo[params[0]][pAdminCP] != 2014)
					{
	    				for(new i = 0; i < MAX_PLAYERS; i++)
				    	{
        					if(PlayerInfo[i][pAdminCP] >= 2013)
				    	    {
            					if(See_MP[i] == 1)
				        	    {
                					format(string, sizeof(string), ":MP: %s(%d) a %s(%d): %s", PlayerName(playerid), playerid, PlayerName(params[0]), params[0], params[1]);
				                	Message(i, 0xFF8000FF, string);
					            }
					        }
					    }
 					}
				}
				else Message(playerid, COLOR_GRAD2, "ЎSusurros solo ha administradores!");
			}
			else Message(playerid, COLOR_GRAD2, "Jugador no conectado.");
        }
		else Message(playerid, COLOR_GRAD2, "Utilize: /w <PlayerID> <Texto>");
        return 1;
    }
Prueba con ese es el de CP y ami me anda re bien. Solo cambia las variables de admin por las tuyas

Edit: Me acabo de dar cuenta que pasaste el comando de Ciudad Prohibida a Zenon City...
Reply
#3

Quote:
Originally Posted by devilcome
Посмотреть сообщение
Код:
    zcmd(w, playerid, params[])
    {
        if(!sscanf(params, "us[128]", params[0], params[1]))
        {
            if(params[0] != INVALID_PLAYER_ID)
    		{
	      		if(PlayerInfo[playerid][pAdminCP] > 0 || PlayerInfo[playerid][pAdminCP] == 0 && PlayerInfo[params[0]][pAdminCP] > 0)
	        	{
	         		if(HidePM[params[0]] == 1 && PlayerInfo[playerid][pAdminCP] < 2013) return Message(playerid, COLOR_GRAD2, "Este administrador/ayudante tiene los susurros bloqueados!");
	         		new string[128];
					format(string, sizeof(string), "Mensaje de %s (%d): %s", PlayerName(playerid), playerid, params[1]);
					Message(params[0], 0xE9BC0AFF, string);
					format(string, sizeof(string), "Susurras a %s (%d): %s", PlayerName(params[0]), params[0] ,params[1]);
					Message(playerid,  0xE9BC0AFF, string);
					if(PlayerInfo[playerid][pAdminCP] != 2014 && PlayerInfo[params[0]][pAdminCP] != 2014)
					{
	    				for(new i = 0; i < MAX_PLAYERS; i++)
				    	{
        					if(PlayerInfo[i][pAdminCP] >= 2013)
				    	    {
            					if(See_MP[i] == 1)
				        	    {
                					format(string, sizeof(string), ":MP: %s(%d) a %s(%d): %s", PlayerName(playerid), playerid, PlayerName(params[0]), params[0], params[1]);
				                	Message(i, 0xFF8000FF, string);
					            }
					        }
					    }
 					}
				}
				else Message(playerid, COLOR_GRAD2, "ЎSusurros solo ha administradores!");
			}
			else Message(playerid, COLOR_GRAD2, "Jugador no conectado.");
        }
		else Message(playerid, COLOR_GRAD2, "Utilize: /w <PlayerID> <Texto>");
        return 1;
    }
Prueba con ese es el de CP y ami me anda re bien. Solo cambia las variables de admin por las tuyas

Edit: Me acabo de dar cuenta que pasaste el comando de Ciudad Prohibida a Zenon City...
Pasa luego algo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)