Kala4ik
Компетентный
Добрый вечер! Столкнулся с такой проблемой, сделал систему граффити все работает, но не могу сделать систему как в сингле чтоб показывало сколько из скольки закрашено.
C++:
new TotGrafiti[5];
new GrafitiCount[MAX_PLAYERS];
enum Grafiti
{
grID,
grBanda,
grObject,
Float:grPosX,
Float:grPosY,
Float:grPosZ,
Float:grPosRotZ
};
new GrafitiInfo[100][Grafiti];
publics LoadGrafity()
{
new rows;
cache_get_row_count(rows);
for(new i = 0; i < rows; i++)
{
new bandgraf;
cache_get_value_name_int(i,"ID",GrafitiInfo[i][grID]);
cache_get_value_name_int(i,"Banda",GrafitiInfo[i][grBanda]);
cache_get_value_name_float(i,"PosX",GrafitiInfo[i][grPosX]);
cache_get_value_name_float(i,"PosY",GrafitiInfo[i][grPosY]);
cache_get_value_name_float(i,"PosZ",GrafitiInfo[i][grPosZ]);
cache_get_value_name_float(i,"PosRotZ",GrafitiInfo[i][grPosRotZ]);
switch(GrafitiInfo[i][grBanda])
{
case 14:bandgraf = 18659,TotGrafiti[0] ++;
case 15:bandgraf = 18665,TotGrafiti[1] ++;
case 16:bandgraf = 18663,TotGrafiti[2] ++;
case 17:bandgraf = 18667,TotGrafiti[3] ++;
case 18:bandgraf = 18661,TotGrafiti[4] ++;
}
GrafitiInfo[i][grObject] = CreateObject(bandgraf, GrafitiInfo[i][grPosX], GrafitiInfo[i][grPosY], GrafitiInfo[i][grPosZ], 0.0, 0.0, GrafitiInfo[i][grPosRotZ]);
}
return 1;
}
publics SecondUpdate()
new Keys,ud,lr;
GetPlayerKeys(i,Keys,ud,lr);
if(Keys == KEY_FIRE || Keys == 132 && GetPlayerWeapon(i) == 41)
{
for(new g = 0; g < sizeof(GrafitiInfo); g++)
{
new bandgraf,count[5],string[36];
switch(GrafitiInfo[g][grBanda])
{
case 14:count[0] --;
case 15:count[1] --;
case 16:count[2] --;
case 17:count[3] --;
case 18:count[4] --;
}
if(!IsPlayerInRangeOfPoint(i,3.0,GrafitiInfo[g][grPosX], GrafitiInfo[g][grPosY],GrafitiInfo[g][grPosZ]))continue;
if(GrafitiInfo[g][grBanda] == GetTeamPlayerID(i))continue;
GrafitiCount[i] ++;
if(GrafitiCount[i] >= 7)
{
switch(GetTeamPlayerID(i))
{
case 14:
{
bandgraf = 18659;
format(string,sizeof(string),RusTextGame("Ãðàôèòè çàêðàøåíî~n~%d èç 100"),count[0]);
GameTextForPlayer(i,string,3000,3);
}
case 15:
{
bandgraf = 18665;
format(string,sizeof(string),RusTextGame("Ãðàôèòè çàêðàøåíî~n~%d èç 100"),count[1]);
GameTextForPlayer(i,string,3000,3);
}
case 16:
{
bandgraf = 18663;
format(string,sizeof(string),RusTextGame("Ãðàôèòè çàêðàøåíî~n~%d èç 100"),count[2]);
GameTextForPlayer(i,string,3000,3);
}
case 17:
{
bandgraf = 18667;
format(string,sizeof(string),RusTextGame("Ãðàôèòè çàêðàøåíî~n~%d èç 100"),count[3]);
GameTextForPlayer(i,string,3000,3);
}
case 18:
{
bandgraf = 18661;
format(string,sizeof(string),RusTextGame("Ãðàôèòè çàêðàøåíî~n~%d èç 100"),count[4]);
GameTextForPlayer(i,string,3000,3);
}
}
DestroyObject(GrafitiInfo[g][grObject]);
GrafitiInfo[g][grObject] = CreateObject(bandgraf,GrafitiInfo[g][grPosX],GrafitiInfo[g][grPosY],GrafitiInfo[g][grPosZ],0.0,0.0,GrafitiInfo[g][grPosRotZ]);
GrafitiInfo[g][grBanda] = Player[i][pLeader];
GrafitiCount[i] = 0;
sql_str[0] = EOS;
mysql_format(database,sql_str,sizeof(sql_str),"UPDATE `grafity` SET `Banda` = '%d' WHERE `ID` = '%d'",GrafitiInfo[g][grBanda],g);
mysql_tquery(database,sql_str);
}
}
}
else if(GrafitiCount[i] > 0) GrafitiCount[i] --;
