17.12.2011, 01:51
Well when i use /orgs it gets the org id right (i made 1 org that is id0) but the org name and leader is wrong and it spams like shit
pawn Код:
CMD:orgs(playerid,params[])
{
new orgsid,orgsname[50],lname[30];
new orgcounting = 1;
SendClientMessage(playerid,-1,"---------------------------Organizations------------------------");
for(new i = 0;i<MAX_ORGS;i++)
{
format(query, sizeof(query), "SELECT * FROM orgs");
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
format(query, sizeof(query), "SELECT * FROM orgs WHERE Orgid = '%d',Name = '%s',Leader = '%s'",orgsid,orgsname,lname);
mysql_query(query);
format(str, sizeof(str), "Organization ID: %d || Organization Name: %s || Organization Leader: %s",orgsid,orgsname,lname);
SendClientMessage(playerid,-1,str);
orgcounting++;
}
if(orgcounting == 1)
{
SendClientMessage(playerid,red,"ERROR: There is no organization created.");
}
}
return 1;
}