About Ten Codes errors [PLEASE FIX!]
#1

I'm Making Dialog spawn with random skin... but when compiled.. i got the errors:

Код:
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(400) : error 001: expected token: "-identifier-", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(401) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 001: expected token: ")", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 029: invalid expression, assumed zero
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : warning 213: tag mismatch
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 215: expression has no effect
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : error 001: expected token: ";", but found ")"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Here's my full code.. Please fix this for me and yes, i will rep!

Код:
public OnPlayerEnterClassSelection(playerid)
{
	//Now show your dialogs here:
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");

	return 0;//returning 0, the player will go to spectate screen
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==1)
    {
         if(!response) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
         if(listitem==0)
         {
              new bool:Success;
              while(!Success)
              {
  //Line 400   new skin=random(300); 
  //Line 401    if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85) 
 //Line 402 || (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211) 
//Line 403  || skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=true; 
                   if(Success)
                   {
                       SpawnPlayer(playerid);
                       SetPlayerSkin(playerid, skin);
                   }
              }
         }
         if(listitem==1)
         {
              new bool:Success=true;
              while(!Success)
              {
                   new skin=random(300); 
                   if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85) 
                   || (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211) 
                   || skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=false;
                   if(Success)
                   {
                       SpawnPlayer(playerid);
                       SetPlayerSkin(playerid, skin);
                   }
              }
         }
    }
    return 1;
}
Reply
#2

Got the code down to two errors which I can't figure out a way to solve it, maybe it's with the fact that there are too many lines of skin definition but well, that's just a guess.

Код:
public OnPlayerEnterClassSelection(playerid)
{

    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");

	return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==1)
    {
         if(!response) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
         if(listitem==0)
         {
              new bool:Success;
              while(!Success)
              {
              new skin=random(300);
              if((skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85) ||
             //Line 22 (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211) ||
               (skin==217) || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=true;
                   if(Success)
                   {
                       SpawnPlayer(playerid);
                       SetPlayerSkin(playerid, skin);
                   }
              }
         }
         if(listitem==1)
         {
              new bool:Success=true;
              while(!Success)
              {
                   new skin=random(300);
                   if((skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85) ||
                  //Line 38 (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211) ||
                   (skin==217) || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=false;
                   if(Success)
                   {
                       SpawnPlayer(playerid);
                       SetPlayerSkin(playerid, skin);
                   }
              }
         }
    }
    return 1;
}
Код:
C:\Users\Razor\Desktop\SAMP\10error.pwn(22) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Razor\Desktop\SAMP\10error.pwn(38) : error 001: expected token: ")", but found "-identifier-"

Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#3

You're much better of declaring an array with male skins and an array with female skins, rather than relying on a loop like that. In theory, if it doesn't find a proper skin it goes forever.
Reply
#4

Quote:

C:\Users\Razor\Desktop\SAMP\10error.pwn(22) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Razor\Desktop\SAMP\10error.pwn(3 : error 001: expected token: ")", but found "-identifier-"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Can you upload your fix?
Reply
#5

Here is the male skins [I am sure there are some missing though but it will work for a random skin]:
Код:
1
2
3
4
5
6
7
8
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
32
33
34
35
36
37
38
42
43
44
45
46
47
48
49
50
51
52
52
57
58
59
60
61
62
66
67
68
70
72
73
78
79
80
81
82
83
84
86
94
95
96
97
98
99
100
101
111
And here are female [SAME AS ABOVE]:
Код:
9
10
11
12
13
31
39
40
41
53
54
55
56
63
64
65
75
76
77
85
87
88
89
90
91
92
93
129
130
131
138
139
140
141
145
148
150
151
152
157
169
172
178
190
191
192
193
194
195
196
197
198
199
201
205
207
214
215
216
218
219
224
225
226
231
232
233
237
238
243
244
245
246
251
256
257
263
298
You will have to convert this to a const array and pick a random one.
Just convet it to an array first than I will tell you what to do next.
Reply
#6

By the way, and this isn't strictly scripting related, but the word is 'gender', and not 'genre'. Thought I'd point this out to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)