Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by Dayrion
Try this, I changed few things to improve your script.
Also, can you post GameTextForPlayerEx?
PHP код:
SaveChar(playerid);
// for(new a = 0; a < 10; a++) if(IsPlayerAttachedObjectSlotUsed(playerid, a)) RemovePlayerAttachedObject(playerid, a);
new lstr[60];
switch(reason)
{
case 0: format(lstr, sizeof(lstr), "%s has left the server. {F81414}(TIMED OUT)", GetName(playerid));
case 1: format(lstr, sizeof(lstr), "%s has left the server. {F81414}(DISCONNECTED)", GetName(playerid));
case 2: format(lstr, sizeof(lstr), "%s has left the server. {F81414}(KICKED / BANNED)", GetName(playerid));
}
SendClientMessageToAll(0xD4D4D4FF,lstr);
foreach(Player, i)
{
if (Specid[i] == playerid && pInfo[i][Spec] == 1)
{
SpecNext(playerid);
GameTextForPlayerEx(playerid,"~R~Player Disconnected",2000,3);
}
}
if(Duel[playerid] >=2)
{
if(Maderequest[playerid] == 1)
{
new PID = Duelopponent[playerid];
SpawnPlayer(PID);
KillTimer(UnDuelend[playerid]);
KillTimer(UnDuelend[PID]);
Duel[PID] = 0;
Duelrounds[PID] = 0;
}
else if(Gotrequest[playerid] == 1)
{
new PID = Duelmaker[playerid];
SpawnPlayer(PID);
KillTimer(UnDuelend[playerid]);
KillTimer(UnDuelend[PID]);
Duel[PID] = 0;
Duelrounds[PID] = 0;
}
}
ResetVariables(playerid);
return 1;
}
|
PHP код:
stock GameTextForPlayerEx(playerid, text[], time, style)
{
new i = 0, len;
while (text[i])
{
if((len = strfind(text[i],"~",true)) != -1)
{
if(text[i] == '~' && IsValidTag(text[i+1]) && text[i+2] == '~')
i = i+2;
else
if(text[i] == '~')
{
strdel(text[i],len,len+1);
continue;
}
}
i++;
}
return GameTextForPlayer(playerid, text, time, style);
}