03.08.2016, 13:57
Здравствуйте,хотел бы узнать правильно ли написал код? можете подправить если требуется?
плюс в конце return true; выдает варнинг
плюс в конце return true; выдает варнинг
PHP код:
public OnPlayerText(playerid, text[])
{
if(PlayerLogin[playerid] == false) return true;
{
new string[128];
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && !PlayerCuffed{playerid})
{
if(IsAGang(playerid))
{
switch(random(7))
{
case 0: ApplyAnimation(playerid,"GHANDS","gsign2",4.0,0,1,1,1,1,1);
case 1: ApplyAnimation(playerid,"GHANDS","gsign4LH",4.0,0,1,1,1,1,1);
case 2: ApplyAnimation(playerid,"GHANDS","gsign3LH",4.0,0,1,1,1,1,1);
case 3: ApplyAnimation(playerid,"GHANDS","gsign4",4.0,0,1,1,1,1,1);
case 4: ApplyAnimation(playerid,"GHANDS","gsign2LH",4.0,0,1,1,1,1,1);
case 5: ApplyAnimation(playerid,"GHANDS","gsign5",4.0,0,1,1,1,1,1);
case 6: ApplyAnimation(playerid,"GHANDS","gsign5LH",4.0,0,1,1,1,1,1);
}
}
else ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,1,1,1,1,1);
SetTimerEx("ClearAnim",2000,false,"i",playerid);
}
foreach(new i: Player)
{
new Float:rdist,c;
rdist = GetPlayerDistanceToPlayer(playerid,i);
if (rdist > 14.0 || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(i)) continue;
switch(floatround(rdist))
{
case 0..4: c = 0xFFFFFFFF;
case 5..8: c = 0xCCCCCCFF;
case 9..14: c = 0xAAAAAAFF;
default: c = 0x888888FF;
}
if(FormaFrac[playerid] == 0)
{
format(string,sizeof(string),"- %s (%s)[%d]",text,PlayerInfo[playerid][pNamePlayer],playerid);
}
else
{
format(string,sizeof(string),"- %s {%s}(%s)[%d]",text,GetFractionColor[PlayerInfo[playerid][pMember]],PlayerInfo[playerid][pNamePlayer],playerid);
}
SendClientMessage(i,c,string);
}
SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 10000);
return false;
}
return true;
}