26.08.2013, 02:46
pawn Код:
CMD:createclan(playerid, params[])
{
//if(ClanExists == 1) return SendClientMessage(playerid,
if(gPlayerInfo[playerid][pScore] < 5000) return SendClientMessage(playerid, ORANGE, "You need 5000 score to create a clan.");
if(gPlayerInfo[playerid][pMoney] < 250000 && gPlayerInfo[playerid][pDonor] < 4) return SendClientMessage(playerid, red, "You need $250,000 to create a clan, if you were a donor this would be free.");
if( sscanf( params, "s[24]", clanname)) return SendClientMessage(playerid, GREY, "Usage: /createclan [ clan name ]");
if(gPlayerInfo[playerid][clanmember] == 1) return SendClientMessage(playerid, red, "You are already a member of a clan.");
if(gPlayerInfo[playerid][clanleader] == 1) return SendClientMessage(playerid, red, "You already own a clan, type /deleteclan if you don't want this clan anymore.");
new query[250];
Query("UPDATE `playerinfo` SET `clanleader` = 1 WHERE `id`='%i'",gPlayerInfo[playerid][pDBID]);
mysql_query( query );
format(ssstring, SOS, "INSERT INTO `clansys` (`clanname`, `clanxp`) VALUES ('%s', '%d')", clanname, gPlayerInfo[playerid][clanxp] = 0);
mysql_query(ssstring);
gPlayerInfo[playerid][clanleader]=1;
//ClanExists = 1;
GivePlayerMoneySync(playerid, -250000);
format(ssstring, SOS,"A new clan has been created clan name: %s | Leader: %s", clanname, gPlayerInfo[playerid][pName]);
SendClientMessageToAll(ORANGE, ssstring);
return 1;
}