Jump to content
  • 0

pomoc Zobrazeni wanted lvl hracu


W1nCZ

Dotaz

Dobrý den, dělám si dcmd zobrazeni wanted levelu všech hráčů(co maj větší než 0), ale píše warningy.

 

 

#include 

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(hledanost, 9,cmdtext);// radek 7
return 1;
}

dcmd_hledanost(playerid)
{
for(new a = 0;a < MAX_PLAYERS; a++)
{
	if(GetPlayerWantedLevel(a) > 0)
    {
		new str[60];
	  	format(str, 60, "Hrac %s ma level hledanosti %d", GetPlayerName(a),GetPlayerWantedLevel(a));// řádek osmnact
		SendClientMessage(playerid, 0xffffff, str);
	}
}
return 1;
}

 

 

warningy

 

 

C:\Users\Winz\Desktop\Docks Town 1.0\hledanost.pwn(7) : warning 202: number of arguments does not match definition
C:\Users\Winz\Desktop\Docks Town 1.0\hledanost.pwn(7) : warning 202: number of arguments does not match definition
C:\Users\Winz\Desktop\Docks Town 1.0\hledanost.pwn(18) : warning 202: number of arguments does not match definition
C:\Users\Winz\Desktop\Docks Town 1.0\hledanost.pwn(18) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.

 

Link to comment
Share on other sites

1 odpověd na tuto otázku

Recommended Posts

  • 0

tve hl. chyby:

#pragma unused params //pise se do DCMD pokud nepouzijes za prikaz text ci cisla

dcmd_hledanost(playerid,params[])

 

jak by to melo vypadat:

dcmd_hledanost(playerid,params[])
{
   #pragma unused params
   for(new i = 0; i    {
       if(GetPlayerWantedLevel(i) > 0)
       {
            new str[100];
            format(str, 100, "Hrac %s ma level hledanosti %d", Jmeno(i),GetPlayerWantedLevel(i));// řádek osmnact
            SendClientMessage(playerid, 0xffffff, str);
       }
   }
return 1;
}

stock Jmeno(playerid)
{
   new j[50];
   GetPlayerName(playerid,j,50);
   return j;
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...