A question for mysql
#1

Is there any way for my /deleteorg command if players that are offline and their organization gets deleted they get auto orgless. Ok this it what i mean.

* Jack joins Grove Street Families (orgid 1)
* Jack quits the server
* Tanush uses /deleteorg 1 Inactive (/deleteorg [orgid] [reason])
* Jack automatically gets -255 for the organization he is in (-255 = orgless)


I just want that if i delete a organization, people that is in that orgid and is offline will get auto orgless. Everything is fine, i only need to add 1 thing that is make the person orgless if he is offline while the organization gets deleted
pawn Код:
CMD:deleteorg(playerid,params[])
{
    new orgid;
    if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params,"is[128",orgid,message)) return SCM(playerid,grey,"USAGE: /deleteorg [orgid] [Reason]");
    if(!DoesOrgExist(orgid))return SCM(playerid,red,"ERROR: This Organization ID is not used.");
    GetPlayerName(playerid,Nam,sizeof(Nam));
    DestroyDynamic3DTextLabel(OrgInfo[orgid][orglabel]);
    DestroyDynamicCP(OrgInfo[orgid][CP]);
    DestroyVehicle(OrgInfo[orgid][Car1]);
    DestroyVehicle(OrgInfo[orgid][Car2]);
    DestroyVehicle(OrgInfo[orgid][Car3]);
    DestroyVehicle(OrgInfo[orgid][Car4]);
    DestroyVehicle(OrgInfo[orgid][Car5]);
    DestroyVehicle(OrgInfo[orgid][Car6]);
    DestroyVehicle(OrgInfo[orgid][Car7]);
    DestroyVehicle(OrgInfo[orgid][Car8]);
    format(str,sizeof(str),"Administrator %s has deleted %s (orgid %d) for %s",Nam,OrgInfo[orgid][Orgname],orgid,message);
    SendClientMessageToAll(COLOR_LIGHTBLUE,str);
    format(str,sizeof(str),"DELETE FROM orgs WHERE Orgid = '%d'",orgid);
    mysql_query(str);
    mysql_free_result();
    foreach(Player,i)
    {
        if(orgid == PlayerData[i][Member])
        {
            PlayerData[i][Member] = -255;
            PlayerData[i][Leader] = 0;
            PlayerData[i][Genre] = 0;
            SetPlayerSkin(i,26);
            SetPlayerColor(i,-1);
            format(str,sizeof(str),"[Org Info]: You are now a civilian because your org has been deleted");
            SCM(i,COLOR_YELLOW,str);
        }
    }
    return 1;
}
Reply


Messages In This Thread
A question for mysql - by Tanush123 - 03.02.2012, 02:44
Re: A question for mysql - by Snowman12 - 03.02.2012, 02:47
Re: A question for mysql - by Tanush123 - 03.02.2012, 03:00
Re: A question for mysql - by [HiC]TheKiller - 03.02.2012, 03:03
Re: A question for mysql - by Tanush123 - 03.02.2012, 03:07
Re: A question for mysql - by jamesbond007 - 03.02.2012, 03:42
Re: A question for mysql - by [MG]Dimi - 03.02.2012, 06:58
Re: A question for mysql - by Tanush123 - 03.02.2012, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)