SA-MP Forums Archive
[Ajuda] Meu novo comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Meu novo comando (/showthread.php?tid=336594)



[Ajuda] Meu novo comando - Urubu_Rei - 22.04.2012

Olб pessoal,

Tentei criar um comando de retirar avisos dos players...
Sу que tem coisa errada, o que pode ser ?

Код:
if(strcmp(cmd, "/raviso", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /raviso [id]");
				return true;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
    if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
				{
					SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
					return true;
				}
			    if(IsPlayerConnected(giveplayerid))
			    {
			        if(giveplayerid != INVALID_PLAYER_ID)
			        {
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USE: /raviso [id]");
							return true;
						}
						PlayerInfo[giveplayerid][pWarns] -= 1;
						}
						format(string, sizeof(string), "AdmCmd: Vocк tirou um aviso do %s", giveplayer);
						SendClientMessage(COLOR_LIGHTRED, string);
						return true;
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Esse nгo й um jogador ativo.");
			}
		}
		return true;
	}



Re: [Ajuda] Meu novo comando - Luiiz - 22.04.2012

o q ta acontecendo n ta compilando ou nao ta funcionando?


Re: [Ajuda] Meu novo comando - Urubu_Rei - 22.04.2012

ele nгo estб compilando


Re: [Ajuda] Meu novo comando - rjjj - 22.04.2012

Quote:
Originally Posted by Urubu_Rei
Посмотреть сообщение
ele nгo estб compilando
Apague esta chave do seu cуdigo :


Код:
PlayerInfo[giveplayerid][pWarns] -= 1;
}

Espero ter ajudado .


Re: [Ajuda] Meu novo comando - Luiiz - 22.04.2012

ja disse /\


Re: [Ajuda] Meu novo comando - Urubu_Rei - 22.04.2012

Deu 1 erro

Код:
C:\new.pwn(33186) : error 035: argument type mismatch (argument 2)



Re: [Ajuda] Meu novo comando - Luiiz - 22.04.2012

posta a linha do erro nй filho ¬¬


Re: [Ajuda] Meu novo comando - Don_Speed - 23.04.2012

Filho assim
pawn Код:
PlayerInfo[giveplayerid][pWarns] -= 1;
                        {
                        format(string, sizeof(string), "AdmCmd: Vocк tirou um aviso do %s", giveplayer);
                        SendClientMessage(COLOR_LIGHTRED, string);}



Re: [Ajuda] Meu novo comando - rjjj - 23.04.2012

Quote:
Originally Posted by Urubu_Rei
Посмотреть сообщение
Deu 1 erro

Код:
C:\new.pwn(33186) : error 035: argument type mismatch (argument 2)
Troque esta linha :


pawn Код:
SendClientMessage(COLOR_LIGHTRED, string);

Por:


pawn Код:
SendClientMessageToAll(COLOR_LIGHTRED, string);


Espero ter ajudado .


Re: [Ajuda] Meu novo comando - Urubu_Rei - 23.04.2012

*Edit

Compilou, mas quando eu digito o comando o aviso do player nгo sai...