Need help.. :( Please help me out.
#1

hello all I need help with this code.. So I have 3 skins in one gang but how can I do it?
Код:
 
warning 206: redundant test: constant expression is non-zero //error 1
warning 217: loose indentation //error 2
Код:
	
        else if (skin == 105, 106, 107) //error 1 is here //Change the 164 According to the Gang So Lets Say gang1 guy skin is 164, This Will Define That 164 is part of gang 3
	{
		pTeam[playerid] = team_GROVEST;
  		SetPlayerTeam(playerid, 1);//Change the id according to gang

	}
and here

Код:
public OnPlayerText(playerid, text[])
{
	if(text[0] == '!')
	{
	new name[24], string[256];
	GetPlayerName(playerid, name, 24);
	format(string, sizeof(string), "[TEAM]%s: %s", name, text[1]);
	for(new c = 0; c < MAX_PLAYERS; c++)
	{
	if(IsPlayerConnected©)
	{
			if(GetPlayerTeam© == GetPlayerTeam(playerid))
			SendClientMessage(c, GetPlayerColor(playerid), string);
			}
		}
		return 0; //error 2 here
	}
	return 1;
}
Thank you for your time and have a good day I hope you will help me.

I know return 0;//is not like it need to be.. but when I'm trying to fix it nothing change.. idk how to do it right.. All time I can fix the errors almost by my self but now with this I'm stuck..
Reply
#2

Код:
warning 217: loose indentation //error 2
https://sampforum.blast.hk/showthread.php?tid=256961
Reply
#3

Hmm how to say .. didn't help me out. but thanks for your post

and now I have this error
Код:
warning 209: function "OnPlayerText" should return a value
error 010: invalid function or declaration
Код:
public OnPlayerText(playerid, text[])
{
	if(text[0] == '!')
	{
	new name[24], string[256];
	GetPlayerName(playerid, name, 24);
	format(string, sizeof(string), "[TEAM]%s: %s", name, text[1]);
	for(new c = 0; c < MAX_PLAYERS; c++)
	{
		if(IsPlayerConnected©)
		{
			if(GetPlayerTeam© == GetPlayerTeam(playerid))
			SendClientMessage(c, GetPlayerColor(playerid), string);
 			}
			return 0; //here 
			}
		}
	}
	return 1; //and here
}
Reply
#4

pawn Код:
else if (skin == 105 || skin == 106 || skin == 107)
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        new name[24], string[256];
        GetPlayerName(playerid, name, 24);
        format(string, sizeof(string), "[TEAM]%s: %s", name, text[1]);
        for(new c = 0; c < MAX_PLAYERS; c++)
        {
            if(IsPlayerConnected(c))
            {
                if(GetPlayerTeam(c) == GetPlayerTeam(playerid))
                    SendClientMessage(c, GetPlayerColor(playerid), string);
            }
        }
        return 0;
    }
    return 1;
}
Reply
#5

You do alot mess with brackets and indentations. You should read Mean's help few more times carefully.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)