22.04.2014, 10:26
any one help? here is the clan create command:
pawn Код:
new string[24];
new rfid = random(9999999);
if(pInfo[playerid][Scores] < 5000) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}You need to have at least 5000 score to make a clan");
if(GetPlayerMoney(playerid) < 1000000) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}You need to have at least 1m of cash to make a clan");
if(sscanf(params,"s[39]",string)) return SendClientMessage(playerid,COLOR_RED,"Usage:/clancreate [clanname]");
if(pInfo[playerid][inclan] == 1) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}You are already in a clan use /clanleave to leave it");
GivePlayerMoney(playerid,-1000000);
pInfo[playerid][clanrank] = 5;
pInfo[playerid][clanid] = rfid;
pInfo[playerid][inclan] = 1;
pInfo[playerid][Money] += -1000000;
format(pInfo[playerid][clanname], 24, string);
new Query[500];
format(Query, 500, "UPDATE `playerdata` SET `clanname` = '%s' WHERE `id` = '%d' LIMIT 1", string, pInfo[playerid][ID]); //Format the query
mysql_query(Query);
return 1;
}