Curret code to toggle a pin
void main ()
{
object oPC = GetHero();
DisplayFloatyMessage(oPC, "Doing It", FLOATY_MESSAGE, 16777215, 20.0);
object oPin = GetPlayerMapPin(oPC,"my_test_pin_1");
if(IsObjectValid(oPin))
{
DisplayFloatyMessage(oPC, "Valid Pin", FLOATY_MESSAGE, 16777215, 20.0);
SetMapPinState (oPin,!GetMapPinState(oPin));
}
else
{
DisplayFloatyMessage(oPC, "Bad Pin", FLOATY_MESSAGE, 16777215, 20.0);
}
}
Get the Doing It message but don't get either Valid Pin or Bad Pin
Can anybody explain this
The state of the Pin doesn't change - Being looking through the stuff in the new kit and cant see these functions anywhere
They seam to be using
WR_SetWorldMapLocationStatus
Has anybody used this? can anybody expain how to use this
Thanks in advance
Trying to get pins working
Débuté par
nn125
, déc. 12 2009 11:31
#1
Posté 12 décembre 2009 - 11:31
#2
Posté 13 décembre 2009 - 12:00
#3
Posté 13 décembre 2009 - 11:45
For anyone who is interested This code seams to work
void main()
{
string sVar = GetLocalString(GetModule(),"RUNSCRIPT_VAR");
int nFind = FindSubString(sVar," ");
string sVal = SubString(sVar,0,nFind);
int iVal = StringToInt(sVal);
object oPC = GetHero();
object oPin = GetObjectByTag("test_pin_1");
if(IsObjectValid(oPin))
{
DisplayFloatyMessage(oPC, "Valid Pin", FLOATY_MESSAGE, 16777215, 20.0);
switch (iVal) {
case 1:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_INACTIVE);
break;
case 2:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_GRAYED_OUT);
break;
case 3:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_ACTIVE);
break;
case 4:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_DESTROYED);
break;
}
}
else
{
DisplayFloatyMessage(oPC, "Bad Pin", FLOATY_MESSAGE, 16777215, 20.0);
}
}
void main()
{
string sVar = GetLocalString(GetModule(),"RUNSCRIPT_VAR");
int nFind = FindSubString(sVar," ");
string sVal = SubString(sVar,0,nFind);
int iVal = StringToInt(sVal);
object oPC = GetHero();
object oPin = GetObjectByTag("test_pin_1");
if(IsObjectValid(oPin))
{
DisplayFloatyMessage(oPC, "Valid Pin", FLOATY_MESSAGE, 16777215, 20.0);
switch (iVal) {
case 1:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_INACTIVE);
break;
case 2:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_GRAYED_OUT);
break;
case 3:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_ACTIVE);
break;
case 4:
WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_DESTROYED);
break;
}
}
else
{
DisplayFloatyMessage(oPC, "Bad Pin", FLOATY_MESSAGE, 16777215, 20.0);
}
}





Retour en haut






