39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
#include "x4_inc_functions"
|
|
int StartingConditional()
|
|
{
|
|
object oStool1 = GetNearestObjectByTag("mpoker_stool1");
|
|
object oStool2 = GetNearestObjectByTag("mpoker_stool2");
|
|
|
|
object oP1 = GetSittingCreature(oStool1);
|
|
object oP2 = GetSittingCreature(oStool2);
|
|
|
|
SetLocalObject(OBJECT_SELF, "oP1", oP1);
|
|
SetLocalObject(OBJECT_SELF, "oP2", oP2);
|
|
|
|
if (GetLocalInt(OBJECT_SELF, "STAGE") == 1)
|
|
{
|
|
//Retrieve PC's message
|
|
string sMessage = GetLocalString(OBJECT_SELF, "SPOKEN");
|
|
int nLength = GetStringLength(sMessage);
|
|
//Let's get rid of the "#"
|
|
sMessage = GetStringRight(sMessage, nLength-1);
|
|
|
|
//Set token
|
|
string sCurrent = GetLocalString(OBJECT_SELF, "CURRENT");
|
|
object oStarter = GetLocalObject(OBJECT_SELF, sCurrent);
|
|
SetCustomToken(916, GetName(oStarter));
|
|
|
|
//Let's try to obtain a number
|
|
int nBet = StringToInt(sMessage);
|
|
if (nBet == 0) //let's check if it's zero due to invalid input
|
|
{
|
|
if (sMessage == "0") return FALSE; //it's valid
|
|
return TRUE; //it's invalid
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|