/gcars VX-RP 2
#1

Hello i've made /gcars command which should count all group cars but i cant get it working
Here's what i made :

pawn Код:
CMD:gcars(playerid, params[]) {
    if(playerVariables[playerid][pGroup] >= 1 && playerVariables[playerid][pGroupRank] >= 4) {
        SendClientMessage(playerid, COLOR_TEAL, "---------------------GROUP CARS---------------------------");
        for(new i = 0; i < MAX_VEHICLES; i++) {
            if(vehicleVariables[i][vVehicleScriptID] == GetPlayerVehicleID(playerid) && vehicleVariables[i][vVehicleGroup])
                {
                format(szMessage, sizeof(szMessage), "* %d %s", vehicleVariables[i][vVehicleScriptID], VehicleNames[GetVehicleModel(i) - 400]);

                }
                SendClientMessage(playerid, COLOR_WHITE, szMessage);
            }
      SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
    }
    return 1;
}
Here is what i get when i type it IG :
Reply
#2

I think this is more of an appropriate if() statement;

EDIT: This will now work with all groups.

pawn Код:
CMD:gcars(playerid, params[]) {
    if(playerVariables[playerid][pGroupRank] >= 4) {
        SendClientMessage(playerid, COLOR_TEAL, "---------------------GROUP CARS---------------------------");
        for(new i = 0; i < MAX_VEHICLES; i++) {
            if(vehicleVariables[i][vVehicleGroup] == playerVariables[playerid][pGroup])
                {
                format(szMessage, sizeof(szMessage), "* %d %s", vehicleVariables[i][vVehicleScriptID], VehicleNames[GetVehicleModel(i) - 400]);

                }
                SendClientMessage(playerid, COLOR_WHITE, szMessage);
            }
      SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
    }
    return 1;
}
Reply
#3

I've tryed that but its only counting the last vehicle that has been added
It needs to count all group cars
Reply
#4

I cant fix this please help !
Reply
#5

BUMP!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)