17.05.2013, 01:06
(
Последний раз редактировалось horsemeat; 17.05.2013 в 22:08.
)
OK I Changed this from warnings to just general problems...
hello i fixed my on problem but ran into another this code does not seem to work can any of you take a look at it and point out and mistakes
hello i fixed my on problem but ran into another this code does not seem to work can any of you take a look at it and point out and mistakes
pawn Код:
if(dialogid == CARCHECK)//mark
{
if((betacheckstate)==1)
{
print("Passed checkcar");
}
if(response)
{
if((betacheckstate)==1)
{
print("Passed response");
}
new ammountofpages = 12 * trackcurrentpage[playerid];
new name[128];
new strcount;
new startcount;
new str[512][13];
if(listitem == 13)
{
if((betacheckstate)==1)
{
print("listitem = 13");
}
for(new count;count < 12;count++)
{
currentpageemptyslots[playerid][count] = 0;
}
new lstpg = trackcurrentpage[playerid] - 1;
if((currentpagestate[lstpg]) ==1)
{
GetPlayerName(playerid, name,sizeof(name));
if((betacheckstate)==1)
{
print("passed currentpagestate");
}
for(new count; count < MAX_VEHICLES;count++)
{
if((carstate[count])==1)
{
if(strcmp(name,carowner[count],true,64)==0)
{
if((ammountofpages) >= startcount)
{
format(str[strcount],sizeof(str),"%s",GetVehicleName(carmid[count]));
if((betacheckstate)==1)
{
printf("adding car to list... model id %s",str[strcount]);
}
strcount ++;
if((strcount)==12)
{
currentpagestate[trackcurrentpage[playerid]] = 1;
if((betacheckstate)==1)
{
print("string full");
}
break;
}
}
else
{
startcount ++;
}
}
}
}
for(new count;count < 12;count++)
{
if(strcmp(str[count],"",true,64)==0)
{
format(str[count],sizeof(str),"EmptySlot");
if((betacheckstate)==1)
{
print("emptyslot added");
}
}
}
if((trackcurrentpage[playerid]) < 1)
{
if((betacheckstate)==1)
{
print("trackcurrentpage is first");
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nnextpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
else if((trackcurrentpage[playerid]) > 1)
{
if((betacheckstate)==1)
{
printf("trackcurrentpage is %i",trackcurrentpage[playerid]);
}
if((currentpagestate[trackcurrentpage[playerid]]) == 1)
{
if((betacheckstate)==1)
{
print("currentpagestate = notlast");
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nnextpage\nbackpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
else
{
if((betacheckstate)==1)
{
print("currentpagestate = last");
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nbackpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
}
trackcurrentpage[playerid] ++;
if((betacheckstate)==1)
{
printf("ShowingPlayerDialog... currentpage:%i",trackcurrentpage[playerid]);
}
ShowPlayerDialog(playerid,CARCHECK,DIALOG_STYLE_LIST,"Track Car",string,"Ok","Close");
}
else
{
goto prev;
if((betacheckstate)==1)
{
print("showing the prev(listitem 14 <back>)");
}
}
return 1;
}
else if(listitem == 14)
{
prev:
if((betacheckstate)==1)
{
print("listitem = 14");
}
for(new count;count < 12;count++)
{
currentpageemptyslots[playerid][count] = 0;
}
trackcurrentpage[playerid] = trackcurrentpage[playerid] -1;
GetPlayerName(playerid, name,sizeof(name));
for(new count; count < MAX_VEHICLES;count++)
{
if((carstate[count])==1)
{
if(strcmp(name,carowner[count],true,64)==0)
{
if((ammountofpages) >= startcount)
{
format(str[strcount],sizeof(str),"%s",GetVehicleName(carmid[count]));
if((betacheckstate)==1)
{
printf("adding car to list... model id %s",str[strcount]);
}
strcount ++;
if((strcount)==12)
{
currentpagestate[trackcurrentpage[playerid]] = 1;
if((betacheckstate)==1)
{
print("string full");
}
break;
}
}
else
{
startcount ++;
}
}
}
}
if((currentpagestate[trackcurrentpage[playerid]])==0)
{
for(new count;count < 12;count++)
{
if(strcmp(str[count],"",true,64)==0)
{
format(str[count],sizeof(str),"EmptySlot");
if((betacheckstate)==1)
{
print("adding emptyslot");
}
}
}
}
if((trackcurrentpage[playerid]) < 1)
{
if((betacheckstate)==1)
{
print("trackcurrentpage is first");
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nnextpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
else if((trackcurrentpage[playerid]) > 1)
{
if((currentpagestate[trackcurrentpage[playerid]]) == 1)
{
if((betacheckstate)==1)
{
printf("trackcurrentpage is %i",trackcurrentpage[playerid]);
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nnextpage\nbackpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
else
{
if((betacheckstate)==1)
{
print("currentpagestate = last");
}
format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\nbackpage",str[0],str[1],str[2],str[3],str[4],str[5],str[6],str[7],str[8],str[9],str[10],str[11],str[12]);
}
}
ShowPlayerDialog(playerid,CARCHECK,DIALOG_STYLE_LIST,"Track Car",string,"Ok","Close");
return 1;
}
else
{
if((betacheckstate)==1)
{
print("you have selected a slot");
}
if((currentpageemptyslots[playerid][listitem])==0)
{
if((betacheckstate)==1)
{
print("the slot is occupide");
}
for(new count;count < 12;count++)
{
currentpageemptyslots[playerid][count] = 0;
}
new jbvehicleid = trackcarid[listitem][trackcurrentpage[playerid]];
SaveCar(carid[jbvehicleid]);
SetPlayerCheckpoint(playerid,carx[jbvehicleid],cary[jbvehicleid],carz[jbvehicleid],8.0);
SendClientMessage(playerid, YELLOW, "Your car is in the check point");
}
else
{
ShowPlayerDialog(playerid,ERRORCHECKCAR,DIALOG_STYLE_MSGBOX,"ERROR","You have selected and empty slot","Back","Close");
}
return 1;
}
}
else
{
SendClientMessage(playerid, RED, "Closed boxes");
}
}