SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 25/05/2011, 04:00 PM   #1
Exsite
Little Clucker
 
Join Date: May 2011
Posts: 15
Reputation: 0
Default Comparing.

Alright, I made this var:
pawn Code:
new defusecode=random(100)+random(100)+random(100);

Now I want to check if the player wrote the same number as the defusecode.

How do I do that?
Exsite is offline  
Old 25/05/2011, 04:01 PM   #2
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: Comparing.

pawn Code:
public OnPlayerText(playerid, text[])
{
  if(strval(text) == defusecode)
  {
    //IT'S THE SAME
  }
  else
  {
    //IT'S NOT THE SAME
  }
  return 1;
}
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline  
Old 25/05/2011, 04:23 PM   #3
Exsite
Little Clucker
 
Join Date: May 2011
Posts: 15
Reputation: 0
Default Re: Comparing.

Thanks, works!
Exsite is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] Comparing names XxCozzaxX Help Archive 4 08/02/2011 03:23 PM
Comparing: Switch() and If() DeathOnaStick Help Archive 5 16/07/2010 07:39 PM
comparing ips ?? BLAbla93 Help Archive 0 23/05/2010 04:55 AM
Name Comparing stock IamNotKoolllll Help Archive 3 24/04/2010 10:30 PM
[help] string comparing borisblat Help Archive 3 22/09/2009 09:30 PM


All times are GMT. The time now is 02:26 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.