[Ajuda] ajuda aki por favor preciso muito
#1

eu nao estou conseguindo colocar esse codigo para /dm [ID]. mais ele estб /dm por distancia me ajuda pfv.

Код HTML:
	  	if(strcmp(cmd, "/dm", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new idperto = GetClosestPlayer(playerid);
			if(IsPlayerConnected(idperto))
			{
			    if(idperto != INVALID_PLAYER_ID)
			    {
			        if(GetDistanceBetweenPlayers(playerid,idperto) < 10)
					{
						format(string, sizeof(string), "ATENЗГO: %s[%d] ACUSOU %s[%d] DE ESTAR A FAZER DM, /TV %d RБPIDO!", PlayerName(playerid),playerid,PlayerName(idperto),idperto,playerid);
						if(PlayerInfo[playerid][pVIP] < 1)
						{
							ABroadCast(COLOR_YELLOW,string,1);
							SendClientMessage(playerid, COLOR_YELLOW, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
						else if(PlayerInfo[playerid][pVIP] == 1)
						{
						    ABroadCast(COLOR_PM,string,1);
							SendClientMessage(playerid, COLOR_PM, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
						else if(PlayerInfo[playerid][pVIP] == 2)
						{
						    ABroadCast(COLOR_ROSA,string,1);
							SendClientMessage(playerid, COLOR_ROSA, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
					    return 1;
					}
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
			    return 1;
			}
		}
		return 1;
	}
Reply
#2

Vocк precisa de algo parecido com isso? https://sampforum.blast.hk/showthread.php?tid=384223

Seria necessбrio alterar a tag da sua publicaзгo para [Pedido] se for o caso.
Reply
#3

nao man й tipo quando o cara estб sofrendo DM ai ele digita /dm e avisa no chat dos admins saca.
Reply
#4

PHP код:
if(strcmp(cmd"/dm"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "%s estб sofrendo DM! - ID[%d]"sendernameplayerid);
                
ABroadCast(COLOR_GREY,string,1);
                
SendClientMessage(playeridCOLOR_GREY"Seu pedido de socorro foi enviado aos         admins..");
        }
        return 
1;
    } 
Agora й sу modificar para suas variбveis
Reply
#5

IGp acho que nгo foi isso que ele pediu mas sim isto:

pawn Код:
if(strcmp(cmd, "/dm", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        new tmp[4];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USO: /dm [id]");
        if(IsPlayerConnected(tmp))
        {
            if(tmp != INVALID_PLAYER_ID)
            {
                format(string, sizeof(string), "ATENЗГO: %s[%d] ACUSOU %s[%d] DE ESTAR A FAZER DM, /TV %d RБPIDO!", PlayerName(playerid),playerid,PlayerName(tmp),tmp,playerid);
                if(PlayerInfo[playerid][pVIP] < 1)
                {
                    ABroadCast(COLOR_YELLOW,string,1);
                    SendClientMessage(playerid, COLOR_YELLOW, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                }
                else if(PlayerInfo[playerid][pVIP] == 1)
                {
                    ABroadCast(COLOR_PM,string,1);
                    SendClientMessage(playerid, COLOR_PM, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                }
                else if(PlayerInfo[playerid][pVIP] == 2)
                {
                    ABroadCast(COLOR_ROSA,string,1);
                    SendClientMessage(playerid, COLOR_ROSA, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
            return 1;
        }
    }
    return 1;
}
Fiz aqui rбpido nгo tenho a certeza se tem algum erro se tiver me avisa!
Reply
#6

Brunox ta dando erro.

Код HTML:
C:\Users\Patricia\Desktop\BGR\gamemodes\BGR.pwn(50071) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Users\Patricia\Desktop\BGR\gamemodes\BGR.pwn(50072) : error 047: array sizes do not match, or destination array is too small
C:\Users\Patricia\Desktop\BGR\gamemodes\BGR.pwn(50074) : error 035: argument type mismatch (argument 1)
C:\Users\Patricia\Desktop\BGR\gamemodes\BGR.pwn(50076) : error 033: array must be indexed (variable "tmp")
C:\Users\Patricia\Desktop\BGR\gamemodes\BGR.pwn(50078) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

me manda a linha onde vc tem new tmp; (sem ser a que eu enviei, por favor)

jб agora envia as linhas do erro ou pelo menos diz qual a linha onde voce meteu o codigo que eu enviei
Reply
#8

sу tem isso dai.

Код HTML:
 	  	if(strcmp(cmd, "/dm", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new idperto = GetClosestPlayer(playerid);
			if(IsPlayerConnected(idperto))
			{
			    if(idperto != INVALID_PLAYER_ID)
			    {
			        if(GetDistanceBetweenPlayers(playerid,idperto) < 10)
					{
						format(string, sizeof(string), "ATENЗГO: %s[%d] ACUSOU %s[%d] DE ESTAR A FAZER DM, /TV %d RБPIDO!", PlayerName(playerid),playerid,PlayerName(idperto),idperto,playerid);
						if(PlayerInfo[playerid][pVIP] < 1)
						{
							ABroadCast(COLOR_YELLOW,string,1);
							SendClientMessage(playerid, COLOR_YELLOW, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
						else if(PlayerInfo[playerid][pVIP] == 1)
						{
						    ABroadCast(COR_PM,string,1);
							SendClientMessage(playerid, COR_PM, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
						else if(PlayerInfo[playerid][pVIP] == 2)
						{
						    ABroadCast(COR_ADMIN2,string,1);
							SendClientMessage(playerid, COR_ADMIN2, "O seu aviso de DeathMatch foi enviado para os administradores online!");
						}
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
					    return 1;
					}
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
			    return 1;
			}
		}
		return 1;
	}
Reply
#9

pawn Код:
if(strcmp(cmd, "/dm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /dm [id]");
                return 1;
            }
            //new idperto = GetClosestPlayer(playerid);
            new acusado = ReturnUser(tmp);
            if(IsPlayerConnected(idperto))
            {
                if(acusado != INVALID_PLAYER_ID)
                {
                    if(GetDistanceBetweenPlayers(playerid,acusado) < 10)
                    {
                        format(string, sizeof(string), "ATENЗГO: %s[%d] ACUSOU %s[%d] DE ESTAR A FAZER DM, /TV %d RБPIDO!", PlayerName(playerid),playerid,PlayerName(acusado),acusado,playerid);
                        if(PlayerInfo[playerid][pVIP] < 1)
                        {
                            ABroadCast(COLOR_YELLOW,string,1);
                            SendClientMessage(playerid, COLOR_YELLOW, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                        }
                        else if(PlayerInfo[playerid][pVIP] == 1)
                        {
                            ABroadCast(COLOR_PM,string,1);
                            SendClientMessage(playerid, COLOR_PM, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                        }
                        else if(PlayerInfo[playerid][pVIP] == 2)
                        {
                            ABroadCast(COLOR_ROSA,string,1);
                            SendClientMessage(playerid, COLOR_ROSA, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                return 1;
            }
        }
        return 1;
    }
Reply
#10

pawn Код:
if(strcmp(cmd, "/dm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /dm [id]");
                return 1;
            }
            new acusado = ReturnUser(tmp);
            if(IsPlayerConnected(idperto))
            {
                if(acusado != INVALID_PLAYER_ID)
                {
                    format(string, sizeof(string), "ATENЗГO: %s[%d] ACUSOU %s[%d] DE ESTAR A FAZER DM, /TV %d RБPIDO!", PlayerName(playerid),playerid,PlayerName(acusado),acusado,playerid);
                    if(PlayerInfo[playerid][pVIP] < 1)
                    {
                        ABroadCast(COLOR_YELLOW,string,1);
                        SendClientMessage(playerid, COLOR_YELLOW, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                    }
                    else if(PlayerInfo[playerid][pVIP] == 1)
                    {
                        ABroadCast(COLOR_PM,string,1);
                        SendClientMessage(playerid, COLOR_PM, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                    }
                    else if(PlayerInfo[playerid][pVIP] == 2)
                    {
                        ABroadCast(COLOR_ROSA,string,1);
                        SendClientMessage(playerid, COLOR_ROSA, "O seu aviso de DeathMatch foi enviado para os administradores online!");
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD1,"Nгo hб ninguйm perto de vocк!");
                return 1;
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)