CMD:territorios(playerid,prarms[])
{
new query[128];
format(query,sizeof query,"SELECT * FROM `gangzoneinfo` WHERE id='%d'",GangZoneInfo[playerid][gzId]);
mysql_function_query(xConexao, query, true, "g@GangZones", "d", playerid);
return 1;
}
forward g@GangZones(playerid);
public g@GangZones(playerid)
{
new rows, fields, /*gzNome[128], gzDono[128],*/ result[128];
cache_get_data(rows, fields, xConexao);
if(rows)
{
cache_get_field_content(0, "name", GangZoneInfo[playerid][gzName], xConexao);
cache_get_field_content(0, "dono", GangZoneInfo[playerid][gzOwner], xConexao);
format(result,sizeof(result),"%s: %d",GangZoneInfo[playerid][gzName],GangZoneInfo[playerid][gzOwner], (GangZoneInfo[playerid][gzOwner] == 1 ? ("Groove Street") : GangZoneInfo[playerid][gzOwner] == 2 ? ("Ballas") : GangZoneInfo[playerid][gzOwner] == 3 ? ("Vagos") : GangZoneInfo[playerid][gzOwner] == 4 ? ("Aztecas") : ("Policia Militar")));
//SendClientMessage(playerid,-1,result);
}
SendClientMessage(playerid,-1,result);
return 1;
}
format(result,sizeof(result),"%s: %d",GangZoneInfo[playerid][gzName],GangZoneInfo[playerid][gzOwner], (GangZoneInfo[playerid][wner] == 1 ?...
new ownername[5] = {"nada","groove","ballas","vagos","aztecas"};
//
format(result,sizeof(result),"%s: %s",GangZoneInfo[playerid][gzName],ownername[GangZoneInfo[playerid][gzOwner]]);
Nгo sei se essa operaзгo ternбria ta certa...
pawn Код:
|
error 018: initialization data exceeds declared size
nao deu deu esse erro que eu nunca vi rsrs
pawn Код:
|
new ownername[5][15];
pawn Код:
|
forward g@GangZones(playerid);
public g@GangZones(playerid)
{
new rows, fields, /*gzNome[128], gzDono[128],*/ result[128];
cache_get_data(rows, fields, xConexao);
if(rows)
{
cache_get_field_content(0, "name", GangZoneInfo[playerid][gzName], xConexao);
cache_get_field_content(0, "dono", result, xConexao);
GangZoneInfo[playerid][gzOwner] = strval(result);
switch(GangZoneInfo[playerid][gzOwner])
{
case 1: format(result, sizeof result, "Groove");
case 2: format(result, sizeof result, "Ballas");
case 3: format(result, sizeof result, "Vagos");
case 4: format(result, sizeof result, "Aztecas");
}
format(result, sizeof result, "%s: %s", GangZoneInfo[playerid][gzName], result);
SendClientMessage(playerid, -1, result);
}
return 1;
}
pawn Код:
|