23 lines
826 B
Plaintext
23 lines
826 B
Plaintext
// squadl_revoke_sq - revoke squad leadership
|
|
#include "color_header"
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetPCSpeaker();
|
|
object oTarget=GetLocalObject(oPC,"oTarget");
|
|
object oMod=GetModule();
|
|
string sID=GetLocalString(oTarget,"sTeamID");
|
|
int nNum=GetLocalInt(oTarget,"nSquadNum");
|
|
object oSQL=GetLocalObject(oMod,"oSquadLead"+sID+IntToString(nNum));
|
|
if (oSQL==oTarget)
|
|
{ // was a squad leader
|
|
DeleteLocalObject(oMod,"oSquadLead"+sID+IntToString(nNum));
|
|
sID=GetName(oPC)+" the leader of your team has removed you as squad leader.";
|
|
sID=ColorRGBString(sID,0,4,1);
|
|
DeleteLocalInt(oTarget,"nSquadNum"); // remove from squad
|
|
SendMessageToPC(oTarget,sID);
|
|
} // was a squad leader
|
|
oSQL=GetItemPossessedBy(oTarget,"rts_it_squadbadge");
|
|
if (oSQL!=OBJECT_INVALID) DestroyObject(oSQL);
|
|
}
|