ID:262932
 
mob
proc
alignupdated()
if(usr.pkpoints >= 23)
usr.side = "Evil"
else
usr.side = "Good"
if(usr.battlemode)
sleep(600)
usr.battlemode = 0
else
sleep(1200)
usr.pkpoints -= 1
spawn(2)
if(usr) alignupdated(usr)

My problem is that, it doesnt change the side, unless I re-log into game and load my character, cuz then it re-run the proc... anyone know wtf is going on?
Don't use usr in procs. Just don't.
In response to Mysame
Aight let me try src then.
In response to ShOcK - True Gaming
Still dun work...

mob
proc
alignupdated()
if(src.pkpoints >= 23)
src.side = "Evil"
else
src.side = "Good"
if(src.battlemode)
sleep(600)
src.battlemode = 0
else
sleep(1200)
src.pkpoints -= 1
spawn(2)
if(src) alignupdated(src)

When I do that, even when I re-log it dun work lol... so I changed it back to usr
In response to ShOcK - True Gaming
How/Where do you call it?
Because, at the bottom, you call it alignmentupdate(src), but you didn't define an argument in your proc.
In response to Mysame
Alright I didnt get u lol...

Here is my code, tell me what to do plz :P

mob
proc
alignupdated()
if(usr.pkpoints >= 23)
src.side = "Evil"
else
usr.side = "Good"
if(usr.battlemode)
sleep(600)
usr.battlemode = 0
else
sleep(1200)
usr.pkpoints -= 1
spawn(2)
if(usr) alignupdated(usr)
In response to ShOcK - True Gaming
Sigh... No choice, then.
First of all, remove the usr. It's NEVER good in a proc. (Except Click()/DblClick() and Login() (when you don't change the client's mob?)).
Then, you see how you've wrote;
alignupdated(usr)

You're passing 'usr' as an argument to the alignupdated() proc. The argument should be transferred like so;
mob/proc/aligupdated(mob/M)

This will redirect usr as a mob specifyed as M.

But to fix your problem, just change the
alignupdated(usr)

to
src.alignupdated


AND REMOVE THE USR.
In response to ShOcK - True Gaming
Mysame gave bad advice- First of all, usr is valid in some procs, but telling you that you shouldn't use usr and you automatically choosing src instead is just as bad a thing to do, I suggest you read up-

http://byondscape.com/ascape.dmb/LummoxJR.2002-1104/
http://bwicki.byond.com/ByondBwicki.dmb?YouProbablyMeantSrc
http://bwicki.byond.com/ByondBwicki.dmb?WhatIsUsr
http://bwicki.byond.com/ByondBwicki.dmb?UsrIsEvil

Also, please don't curse.. it serves no purpose and this is an all-ages forum.
As for your problem:
mob/proc
alignupdated()
src.side = "[(pkpoints>=23)?"Evil":"Good"]"
if(src.battlemode)
sleep(600)
src.battlemode=0 // They could log out during the sleep() time.
else
sleep(1200)
src.pkpoints-- // Same here.
spawn(2) src.alignupdated()
In response to Artemio
I did tell him it's valid in some procs, oh great drug taker Arty >.>
In response to Mysame
You didn't tell him why or a link to explain why, you gave a few examples but not a complete list, and your first post said "Don't use usr in procs. Just don't.".