14.08.2010, 15:11
(
Последний раз редактировалось ipsBruno; 14.08.2010 в 15:32.
)
@JatoDie
Use Macro
¬¬
@MenaceX:
Otimize Your Loop ¬¬
@Hiddos
No Called Functions ¬¬
Use:
Final:
Or
Use Macro

pawn Код:
#define PlayerExecute(playerid,%2) if(%2[0] == '/') OnPlayerText(playerid,%2)
@MenaceX:
pawn Код:
PlayerName(playerid)
{
new n[24];
GetPlayerName(playerid,n,24);
for(new i=0,j = strlen(n); i <= j;++i)
if(n[i]=='_') n[i]=' ';
return n;
}
@Hiddos
pawn Код:
public OnGameModeInit()
{
SetTimer("JPD",7500,true);
return 1;
}
forward JPD();
public JPD()
{
for(new i, j = MAX_PLAYERS; i < j ; ++ i)
{
if(IsPlayerConnected(i) && GetPlayerSpecialAction(i) == 2)
{
//Do your thing
}
}
return 1;
}
Quote:
pawn Код:
|
Use:
pawn Код:
stock TagDetect(playerid)
{
new string[MAX_PLAYER_NAME];
GetPlayerName(playerid, tring,MAX_PLAYER_NAME);//No Use sizeof (called function)
if(string[0] == '[' > string[0] == ']') return 1;//No Use strfind (called function)
else return 0;
}
Final:
pawn Код:
stock RetireTag(playerid)
{
new string[MAX_PLAYER_NAME];
GetPlayerName(playerid, tring,MAX_PLAYER_NAME);//No Use sizeof (called function)
if(string[0] == '[' && string[0] == ']')
{
strdel(name, string[0] == '[', string[0] == ']' + 1);
if(string[0])
{
SetPlayerName(playerid, name);
}
}
}
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
new
startpos = strfind(name, "[", true),
endpos = strfind(name, "]", true);
if(startpos != -1 && endpos != -1)
{
strdel(name, startpos, endpos + 1);
if(name[0])
{
SetPlayerName(playerid, name);
}
}