![]() |
#1 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2008
Posts: 788
Reputation: 34
|
![]()
Hello everyone =)
I've tried to make a command witch sets the Sex for a person. /set [sex] [male/female] I will add more then /set sex soon... it will be like: /set [sex/age/city] I want so when you type /set sex, it shows: ".: Usage: /set [sex] [male/female] :." but when you only type /set, it shows: ".: Usage: /set [sex] :." Here is the command: pawn Code:
Thank you =) |
![]() |
![]() |
#2 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
|
![]() pawn Code:
Change this line i guess Also, from what I'm seeing here, you're comparing a character with a string ? This will never work. Just use sscanf pawn Code:
|
![]() |
![]() |
#3 |
Big Clucker
![]() ![]() Join Date: Jun 2008
Posts: 113
Reputation: 0
|
![]()
It will be better to use sscanf; it is much more secure & better
![]() |
![]() |
![]() |
#4 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2008
Posts: 788
Reputation: 34
|
![]()
I didn't think sscanf would work :O
I'll try it... xD |
![]() |
![]() |
#5 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2009
Location: Toronto
Posts: 1,498
Reputation: 157
|
![]()
yea once you go sscanf you never go back ^^
|
![]() |
![]() |
#6 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2008
Posts: 788
Reputation: 34
|
![]() pawn Code:
I get those errors: Code:
C:\Documents and Settings\IntrozeN\Desktop\SAMP\Copy of samp server\gamemodes\CLRP.pwn(2643) : error 033: array must be indexed (variable "-unknown-") C:\Documents and Settings\IntrozeN\Desktop\SAMP\Copy of samp server\gamemodes\CLRP.pwn(2649) : error 033: array must be indexed (variable "-unknown-") |
![]() |
![]() |
#7 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
|
![]()
You declared value as an integer. Declare it as a string and then compare using strcmp
|
![]() |
![]() |
#8 | |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2008
Posts: 788
Reputation: 34
|
![]() Quote:
![]() ![]() ![]() |
|
![]() |
![]() |
#9 |
Big Clucker
![]() ![]() Join Date: Jun 2008
Posts: 113
Reputation: 0
|
![]()
of course people do wrong when they dont know how & what "sscanf" do; processing & SAVING; so you must saved values with what you want; eg: if(!strcmp(thing, "male")) { ... } and not params[]...
|
![]() |
![]() |
#10 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
|
![]() pawn Code:
edited |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hello i have problem with dialog male female and years | mata014 | Help Archive | 0 | 07/07/2010 02:26 PM |