08.04.2009, 22:34
I shall now inspect them, and comment (I may add the the comment several times...)
First thing: stock vehicle_bootPassengers(vehicleid)
The vehicleid is never used during this stock, I think the code will boot every passenger on the server.
Second Thing: I don't know if it's a big deal, but in vehicle_fix and vehicle_kill you use integers instead of Floats. If this were compiled it would complain but as it's an include you'd never know!
Third thing: This is trivial but: (I suspect you already knew this but forgot to do it as you used in one of the other cases!)
Fourth Thing: In "player_giveHealthBoost" is the percentage a number between 0 and 1?
Fifth Thing: You use strings of size [256]. They do not need to be this big, click HERE to see why!
Sixth Thing: GetPlayerName(playerid, result, 256); --> GetPlayerName(playerid, result, sizeof(result));
Seventh Thing: Just for the record, what is this for?:
Eighth Thing: string_insert(str[], str2[]) ---> This is already covered by Strcat. Click HERE.
Ninth Thing: What was wrong with strlen?:
Tenth (and final) Thing: I'm not going into the string stuff as i'm not 100% familiar with it, but it looks promising. I like the look of string_replace_chars, just thinking of funny things I could do with it >.>
Note: Don't get me wrong, this is a really good include, i'm just finding anything that could be improved!
First thing: stock vehicle_bootPassengers(vehicleid)
The vehicleid is never used during this stock, I think the code will boot every passenger on the server.
Second Thing: I don't know if it's a big deal, but in vehicle_fix and vehicle_kill you use integers instead of Floats. If this were compiled it would complain but as it's an include you'd never know!
Third thing: This is trivial but: (I suspect you already knew this but forgot to do it as you used in one of the other cases!)
pawn Код:
case 10, 11, 12, 13:
could be:
case 10 .. 12
Fifth Thing: You use strings of size [256]. They do not need to be this big, click HERE to see why!
Sixth Thing: GetPlayerName(playerid, result, 256); --> GetPlayerName(playerid, result, sizeof(result));
Seventh Thing: Just for the record, what is this for?:
pawn Код:
stock string_reset(){
new strresult[256];
return strresult;
}
Ninth Thing: What was wrong with strlen?:
pawn Код:
stock string_length(str[]){
return(strlen(str));
}
Note: Don't get me wrong, this is a really good include, i'm just finding anything that could be improved!