hello,
i couldn't connect to forum.sa-mp.com for a question i wanted to post, and i searched on why it's removed or something, until i found out that this forum is similar to forum.sa-mp.com, if not the same. anyways, to the question. is it possible to replace the following code into Y_INI ? cbug, time/name related.
if you'd like any other information, please tell me.
i couldn't connect to forum.sa-mp.com for a question i wanted to post, and i searched on why it's removed or something, until i found out that this forum is similar to forum.sa-mp.com, if not the same. anyways, to the question. is it possible to replace the following code into Y_INI ? cbug, time/name related.
PHP Code:
//=============================| CBUG System |================================//
if(matching[playerid] ==1 && GetPlayerWeapon(playerid) == 24)
{
new playerammo = GetPlayerAmmo(playerid);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
if(playerammo != ammo[playerid])
{
ammo[playerid]=playerammo;
if(ammo[playerid]== 6) return ptickcount[playerid] = GetTickCount();
if(ammo[playerid]== 0)
{
ammo[playerid] =-1;
matching[playerid] =0;
new string[32];
new time = GetTickCount()-ptickcount[playerid];
format(string, sizeof(string),"Time: %s seconds (/records)", Comma(time));
SendClientMessage(playerid, COLOR_WHITE, string);
SetPlayerPos(playerid, px[playerid], py[playerid], pz[playerid]);
for(new j=0; j<11; j++) GivePlayerWeapon(playerid, Weapons[playerid][j], Ammo[playerid][j]);
if(top1 == -1)
{
top1 = time;
format(topname1, sizeof(topname1), "%s", pname);
return 1;
}
else if(time < top1)
{
top5 = top4;
top4 = top3;
top3 = top2;
top2 = top1;
top1 = time;
format(topname5, sizeof(topname5), "%s", topname4);
format(topname4, sizeof(topname4), "%s", topname3);
format(topname3, sizeof(topname3), "%s", topname2);
format(topname2, sizeof(topname2), "%s", topname1);
format(topname1, sizeof(topname1), "%s", pname);
return 1;
}
else if(top2 == -1)
{
top2 = time;
format(topname2, sizeof(topname2), "%s", pname);
return 1;
}
else if(time < top2)
{
top5 = top4;
top4 = top3;
top3 = top2;
top2 = time;
format(topname5, sizeof(topname5), "%s", topname4);
format(topname4, sizeof(topname4), "%s", topname3);
format(topname3, sizeof(topname3), "%s", topname2);
format(topname2, sizeof(topname2), "%s", pname);
return 1;
}
else if(top3 == -1)
{
top3 = time;
topname3 = pname;
return 1;
}
else if(time < top3)
{
top5 = top4;
top4 = top3;
top3 = time;
format(topname5, sizeof(topname5), "%s", topname4);
format(topname4, sizeof(topname4), "%s", topname3);
format(topname3, sizeof(topname3), "%s", pname);
return 1;
}
else if(top4 == -1)
{
top4 = time;
format(topname4, sizeof(topname4), "%s", pname);
return 1;
}
else if(time < top4)
{
top5 = top4;
top4 =time;
format(topname5, sizeof(topname5), "%s", topname4);
format(topname4, sizeof(topname4), "%s", pname);
return 1;
}
else if(top5 == -1)
{
top5 = time;
format(topname5, sizeof(topname5), "%s", pname);
return 1;
}
else if(time < top5)
{
top5 = time;
format(topname5, sizeof(topname5), "%s", pname);
return 1;
}
return 1;
}
}
}
//============================================================================//
return 1;
}
if you'd like any other information, please tell me.