C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(23746) : warning 209: function "cmd_checkweapons" shou
#1

C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(23746) : warning 209: function "cmd_checkweapons" should return a value

Код:
CMD:checkweapons(playerid,params[])
{
	new temp[100], idx, targetid, string[256];
			if(IsPlayerConnected(playerid))
			{
				if (PlayerInfo[playerid][pAdmin] < 1)
			    {
				    SendClientMessage(playerid, COLOR_ERROR, "You are not authorized");
				    return 1;
			    }
				temp = strtok(params,idx);
				if (!strlen(temp))
			    {
				    SendClientMessage(playerid, COLOR_WHITE, "Synthax: /checkweapons <playerid/partOfName>");
				    return 1;
			    }
				targetid = ReturnUser(temp);
				if (targetid == INVALID_PLAYER_ID)
			    {
				    SendClientMessage(playerid, COLOR_ERROR, "That player is offline");
				    return 1;
			    }
				new weaponsmodel, ammunition;
				
	   			new playername[MAX_PLAYER_NAME];
			  	GetPlayerName(targetid, playername, MAX_PLAYER_NAME);
				format(string, sizeof(string), "%s has the following weapons:", playername);

				for (new i=0; i<9; i++)
			    {
				    GetPlayerWeaponData(targetid, i, weaponsmodel, ammunition);
				    if(weaponsmodel != 0)
				    {
				        format(string, sizeof(string), "%d: %d (%d)", i, weaponsmodel, ammunition);
				    	SendClientMessage(playerid, COLOR_ADMIN_INFO, string);
					}
			    }
			}
		}
Reply
#2

Before last } put return 1;
Reply
#3

PHP код:
CMD:checkweapons(playerid,params[])
{
    new 
temp[100], idxtargetidstring[256];
            if(
IsPlayerConnected(playerid))
            {
                if (
PlayerInfo[playerid][pAdmin] < 1)
                {
                    
SendClientMessage(playeridCOLOR_ERROR"You are not authorized");
                    return 
1;
                }
                
temp strtok(params,idx);
                if (!
strlen(temp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"Synthax: /checkweapons <playerid/partOfName>");
                    return 
1;
                }
                
targetid ReturnUser(temp);
                if (
targetid == INVALID_PLAYER_ID)
                {
                    
SendClientMessage(playeridCOLOR_ERROR"That player is offline");
                    return 
1;
                }
                new 
weaponsmodelammunition;
                
                   new 
playername[MAX_PLAYER_NAME];
                  
GetPlayerName(targetidplayernameMAX_PLAYER_NAME);
                
format(stringsizeof(string), "%s has the following weapons:"playername);

                for (new 
i=0i<9i++)
                {
                    
GetPlayerWeaponData(targetidiweaponsmodelammunition);
                    if(
weaponsmodel != 0)
                    {
                        
format(stringsizeof(string), "%d: %d (%d)"iweaponsmodelammunition);
                        
SendClientMessage(playeridCOLOR_ADMIN_INFOstring);
                    }
                }
            }
 return 
1;
        } 
there just need a return 1 ;

REP me if it helpful
Reply
#4

Quote:
Originally Posted by SoFahim
Посмотреть сообщение
PHP код:
CMD:checkweapons(playerid,params[])
{
    new 
temp[100], idxtargetidstring[256];
            if(
IsPlayerConnected(playerid))
            {
                if (
PlayerInfo[playerid][pAdmin] < 1)
                {
                    
SendClientMessage(playeridCOLOR_ERROR"You are not authorized");
                    return 
1;
                }
                
temp strtok(params,idx);
                if (!
strlen(temp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"Synthax: /checkweapons <playerid/partOfName>");
                    return 
1;
                }
                
targetid ReturnUser(temp);
                if (
targetid == INVALID_PLAYER_ID)
                {
                    
SendClientMessage(playeridCOLOR_ERROR"That player is offline");
                    return 
1;
                }
                new 
weaponsmodelammunition;
                
                   new 
playername[MAX_PLAYER_NAME];
                  
GetPlayerName(targetidplayernameMAX_PLAYER_NAME);
                
format(stringsizeof(string), "%s has the following weapons:"playername);
                for (new 
i=0i<9i++)
                {
                    
GetPlayerWeaponData(targetidiweaponsmodelammunition);
                    if(
weaponsmodel != 0)
                    {
                        
format(stringsizeof(string), "%d: %d (%d)"iweaponsmodelammunition);
                        
SendClientMessage(playeridCOLOR_ADMIN_INFOstring);
                    }
                }
            }
 return 
1;
        } 
there just need a return 1 ;

REP me if it helpful
Rofl thanks for the repeat
Reply
#5

Kindly don't beg for reps.
Reply
#6

Quote:
Originally Posted by SpikY_
Посмотреть сообщение
Kindly don't beg for reps.
I said Rep me if it helpful . I didn't beg -_- WTF is going on to the ppl
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)