01.09.2011, 20:13
Why when i use /setowep1 for a weapon for a gang and use /setleader they never get the gang in Weapon1= (it still saved on my .ini)
pawn Код:
CMD:setowep1(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"ii",org,wep1)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setowep1 [orgid] [weaponid]");
format(oFile,sizeof(oFile),"DynamicOrgs/%i.ini",org);
GetWeaponName(wep1,WeapName,32);
{
if(!dini_Exists(oFile)) return SendClientMessage(playerid,red,"ERROR: That Organization Id is INVALID!");
format(str,sizeof(str),"You have set org (ID: %d) Weapon 1 to %s (ID: %d)",org,WeapName,wep1);
SendClientMessage(playerid,orange,str);
dini_IntSet(oFile,"Weapon1",wep1);
}
return 1;
}
pawn Код:
CMD:setleader(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"ui",ID,org)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setleader [playerid / Partofname] [orgid]");
if(!dini_Exists(oFile)) return SendClientMessage(playerid,orange,"Organization id is not in use.");
if(PlayerData[ID][Job] > 0) return SendClientMessage(playerid,red,"ERROR: That user is in a job!");
GetPlayerName(playerid,Nam,sizeof(Nam));
GetPlayerName(ID,pname,sizeof(pname));
format(oFile,sizeof(oFile),"DynamicOrgs/%i.ini",org);
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!");
format(str,sizeof(str),"You have set %s the org leader of org (ID: %d)",pname,org);
SendClientMessage(playerid,orange,str);
format(str,sizeof(str),"Administrator %s has set you the leader of org (ID: %d)",Nam,org);
SendClientMessage(ID,orange,str);
GetPlayerName(ID,pname,sizeof(pname));
format(oFile,sizeof(oFile),"DynamicOrgs/%1.ini");
{
PlayerData[ID][Member] = orgid;
PlayerData[ID][Leader] = 1;
PlayerData[ID][IsInOrg] = 1;
dini_Set(oFile,"Leader",pname);
SetPlayerColor(ID,HexToInt(dini_Get(oFile,"Color")));
GivePlayerWeapon(playerid,dini_Int(oFile,"Weapon1"),5000);
GivePlayerWeapon(playerid,dini_Int(oFile,"Weapon2"),5000);
}
format(oFile,sizeof(oFile),"DynamicOrgs/%2.ini");
{
PlayerData[ID][Member] = orgid;
PlayerData[ID][Leader] = 1;
PlayerData[ID][IsInOrg] = 1;
dini_Set(oFile,"Leader",pname);
SetPlayerColor(ID,HexToInt(dini_Get(oFile,"Color")));
GivePlayerWeapon(playerid,dini_Int(oFile,"Weapon1"),5000);
GivePlayerWeapon(playerid,dini_Int(oFile,"Weapon2"),5000);
}
return 1;
}