SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/12/2011, 11:22 PM   #1
Outcast
Huge Clucker
 
Join Date: Jan 2011
Location: Croatia
Posts: 253
Reputation: 3
Default What does this means?

Code:
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
	    {
	        Ban(playerid); //bans the player
	    }
What does the "== 0" part means? Will it ban the player if it just says "Ban" in the script file or it will ban only if Ban=0 ?

Please help, thank you.
Outcast is offline   Reply With Quote
Old 29/12/2011, 11:29 PM   #2
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,734
Reputation: 238
Default Re: What does this means?

http://wiki.sa-mp.com/wiki/Strcmp
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
Youtube channel: https://www.youtube.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business
PowerPC603 is offline   Reply With Quote
Old 29/12/2011, 11:33 PM   #3
Outcast
Huge Clucker
 
Join Date: Jan 2011
Location: Croatia
Posts: 253
Reputation: 3
Default Re: What does this means?

So, if in the userfile it says Ban=1, and I type into the strcmp if(strcmp(string, "Ban=1", true) == 0) it will then ban the player? Right?
Outcast is offline   Reply With Quote
Old 29/12/2011, 11:37 PM   #4
[ABK]Antonio
High-roller
 
[ABK]Antonio's Avatar
 
Join Date: Sep 2011
Location: ID, USA
Posts: 1,224
Reputation: 185
Default Re: What does this means?

if that's on onplayercommandtext it will ban you if you type /ban or if its on onplayertext and string = text then it will ban you too
__________________

ABKClan.com
[ABK]Antonio is offline   Reply With Quote
Old 29/12/2011, 11:41 PM   #5
JiHost
Huge Clucker
 
Join Date: Sep 2011
Location: JiHost.co.uk
Posts: 314
Reputation: 44
Default Re: What does this means?

strcmp returns 0 if strings you are comparing are same.
JiHost is offline   Reply With Quote
Reply

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
What this Means ? Black Axe Scripting Help 2 02/12/2011 03:04 PM
What this means? Millionaire Everything and Nothing 7 08/10/2011 10:23 AM
what this means? mhking Everything and Nothing 6 03/01/2011 04:31 PM
Can anybody tell me what this means? Jeffry Help Archive 6 03/12/2010 08:59 PM
what means this .. Matej_ Help Archive 4 19/09/2010 02:26 PM


All times are GMT. The time now is 12:03 AM.


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