Hmmmm?
Posted: September 26th, 2007, 10:25 pm
Well I am still working on my admin mod adding new features and such and I came across the idea of a feature where you can freeze a player. So I went to a very useful person (nightmare) and I asked for a little help and we came up with this...
Then I asked nightmare why do you think this doesnt work and he said its because its not in a loop. The only problem I im getting a script compile error on the line
Any suggestions or help. I also do not know how to do loops. so if someone could help that would be great
The thing I have is. I need the loop to continue until the command p_unfreeze (playerID) is executed then stop...
My next feature is a BURN feature. Kinda like CS:S
Code: Select all
main()
{
thread freeze();
}
freeze()
{
self endon("boot");
setcvar("p_freeze", "");
while(1)
{
if(getcvar("p_freeze") != "")
{
deathPlayerNum = getcvarint("p_freeze");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
thisPlayerNum = players[i] getEntityNumber();
if(thisPlayerNum == deathPlayerNum)
{
players[i] self user.orgin();
players[i] self set user.orgin();
}
}
setcvar("p_freeze", "");
}
wait 0.05;
}
}
Code: Select all
players[i] self user.orgin();
The thing I have is. I need the loop to continue until the command p_unfreeze (playerID) is executed then stop...
My next feature is a BURN feature. Kinda like CS:S