Nubbs Posted March 1, 2009 Author Share Posted March 1, 2009 ok so cases "0" and "1" dont work at all, but cases "2" and "3" work fine what am i doing wrong? EE 2.7```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 If GetPlayerClass(Index) = 0 Then If int(GetPlayerSprite(Index)) <> 9 Then Call PutVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite", GetPlayerSprite(index)) Call SetPlayerSprite(Index, 9) Call PlayerMsg(index, "You started patrolling.", 2) Call SendPlayerData(index) End If End If Case 1 Dim Sprite Sprite = int(GetVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite")) If int(GetPlayerSprite(Index)) = 9 Then Call SetPlayerSprite(Index, Sprite) Call PlayerMsg(index, "Feels good to be off the clock huh?", 2) Call SendPlayerData(index) Else Call PlayerMsg(Index, "This is definatly NOT where you parked your car! RAWR", 12) End If Case 2 If GetPlayerClass(Index) = 1 Then If int(GetPlayerSprite(Index)) <> 10 Then Call PutVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite", GetPlayerSprite(index)) Call SetPlayerSprite(Index, 10) Call PlayerMsg(index, "You started rollin'.", 2) Call SendPlayerData(index) End If End If Case 3 If int(GetPlayerSprite(Index)) = 10 Then Call SetPlayerSprite(Index, Sprite) Call PlayerMsg(index, "Feels good to be off the streets huh?", 2) Call SendPlayerData(index) Else Call PlayerMsg(Index, "This is definatly NOT where you parked your thug car! RAWR", 12) End If End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Fulou Posted March 1, 2009 Share Posted March 1, 2009 it should be the other way around, you havent defined Sprite in the third case.I cant really see any errors at the moment.Edit :And you had an appostraphy in the playermessage of case 2.```'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.Sub ScriptedTile(Index, Script)' Executes when a player steps onto a scripted tile.'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.Dim SpriteSprite = int(GetVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite")) Select Case Script Case 0 If GetPlayerClass(Index) = 0 Then If int(GetPlayerSprite(Index)) <> 9 Then Call PutVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite", GetPlayerSprite(index)) Call SetPlayerSprite(Index, 9) Call PlayerMsg(index, "You started patrolling.", 2) Call SendPlayerData(index) End If End If Case 1 If int(GetPlayerSprite(Index)) = 9 Then Call SetPlayerSprite(Index, Int(Sprite)) Call PlayerMsg(index, "Feels good to be off the clock huh?", 2) Call SendPlayerData(index) Else Call PlayerMsg(Index, "This is definatly NOT where you parked your car! RAWR", 12) End If Case 2 If GetPlayerClass(Index) = 1 Then If int(GetPlayerSprite(Index)) <> 10 Then Call PutVar("scripts\" & trim(GetPlayerName(index)) & ".ini", "TRANSFORMS", "player_sprite", GetPlayerSprite(index)) Call SetPlayerSprite(Index, 10) Call PlayerMsg(index, "You started rollin.", 2) Call SendPlayerData(index) End If End If Case 3 If int(GetPlayerSprite(Index)) = 10 Then Call SetPlayerSprite(Index, Int(Sprite)) Call PlayerMsg(index, "Feels good to be off the streets huh?", 2) Call SendPlayerData(index) Else Call PlayerMsg(Index, "This is definatly NOT where you parked your thug car! RAWR", 12) End If End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Nubbs Posted March 1, 2009 Author Share Posted March 1, 2009 i wasnt sure where to place the Dim thanks, and does the appostraphy in the playermessage of case 2\. make a difference? case 2 works Link to comment Share on other sites More sharing options...
Nubbs Posted March 1, 2009 Author Share Posted March 1, 2009 moving the Dim worked thanks it was driving me crazy Link to comment Share on other sites More sharing options...
Nubbs Posted March 1, 2009 Author Share Posted March 1, 2009 oh yea the *apostrophe in Case 2's playermsg does effect anything just in case someone was wondering Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now