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 Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/ Share on other sites More sharing options...
revraz Posted December 24, 2008 Share Posted December 24, 2008 Simple IF statements should work. Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/#findComment-723374 Share on other sites More sharing options...
Jiraiya Posted December 24, 2008 Author Share Posted December 24, 2008 what do you mean? Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/#findComment-723379 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 } Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/#findComment-723383 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" Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/#findComment-723386 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. Link to comment https://forums.phpfreaks.com/topic/138341-how-would-i-do-this/#findComment-723388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.