Jiraiya Posted December 24, 2008 Share Posted December 24, 2008 im wondering how i would go about creating a script that makes it so that players in my game can only attack other players if both players have a variable that are the same for example: player A location: home Player B location: town player A and or B can not attack each other Player A loation town player B location town players should be able to attack each other. what kind of script would i have to create? any tutorial sites ore example code would be nice thanks Quote Link to comment Share on other sites More sharing options...
revraz Posted December 24, 2008 Share Posted December 24, 2008 Simple IF statements should work. Quote Link to comment Share on other sites More sharing options...
Jiraiya Posted December 24, 2008 Author Share Posted December 24, 2008 what do you mean? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 24, 2008 Share Posted December 24, 2008 $playerA = "outside"; $playerB = "inside"; IF ($playerA == $playerB) { //they can attack } else { //they can't attack } Quote Link to comment Share on other sites More sharing options...
Jiraiya Posted December 24, 2008 Author Share Posted December 24, 2008 what script would i need to add to make it so the player wouldnt be able to run the attack php script unless both are player variable locations are set to "Area" Quote Link to comment Share on other sites More sharing options...
revraz Posted December 24, 2008 Share Posted December 24, 2008 Just as I posted the example. It kinda sounds like you don't know much PHP, in which case, you may want to learn some as you create this project. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.