if(!strcmp(cmdtext, "/test", true))
{
HasClothes[playerid]=2;
ClothesItems[playerid][1]=10;
ClothesItems[playerid][2]=20;
while( HasClothes[playerid]==idx )
{
idx ++;
}
for(new i = 0; i < idx; i++)
{
format( string, sizeof string, "slot %d|item id %d",idx,ClothesItems[playerid][idx]);
SendClientMessage( playerid, -1, string );
}
return 1;
}
slot 1|item id 10 slot 2|item id 20
if(!strcmp(cmdtext, "/test", true))
{
HasClothes[playerid]=2;//I am using 2 slots
ClothesItems[playerid][1]=10;//slot 1 is using clothesid 10
ClothesItems[playerid][2]=20;//slot 2 is using clothesid 20
while( HasClothes[playerid]==idx )
{
idx ++;//count the slots that are using so i am using 2
}
for(new i = 0; i < idx; i++)//the counting slots getting returned here so i want 2 sendclientmessages
{
format( string, sizeof string, "slot %d|item id %d",idx,ClothesItems[playerid][idx]);//idx should be the slot number and itemid is the clothesid
SendClientMessage( playerid, -1, string );
}
return 1;
}
slot 1|item id 10 slot 2|item id 20
|
Why not just use "HasClothes" in the loop directly? |
if(!strcmp(cmdtext, "/test", true))
{
HasClothes[playerid]=2;//I am using 2 slots
ClothesItems[playerid][1]=10;//slot 1 is using clothesid 10
ClothesItems[playerid][2]=20;//slot 2 is using clothesid 20
for(new i = 0; i < HasClothes[playerid]; i++)
{
format( string, sizeof string, "slot %d|item id %d",i,ClothesItems[playerid][i]);
SendClientMessage( playerid, -1, string );
}
return 1;
}
slot 0|item id 0 slot 1|item id 10
if(!strcmp(cmdtext, "/test", true))
{
HasClothes[playerid]=2;//I am using 2 slots
ClothesItems[playerid][1]=10;//slot 1 is using clothesid 10
ClothesItems[playerid][2]=20;//slot 2 is using clothesid 20
for(new i = 1; i <= HasClothes[playerid]; i++)
{
format( string, sizeof string, "slot %d|item id %d",i,ClothesItems[playerid][i]);
SendClientMessage( playerid, -1, string );
}
return 1;
}