Quote:
Originally Posted by wups
pawn Код:
if(!strcmp(cmdtext, "/killall", true)) { KillAll; return 1; } if(!strcmp(cmdtext, "/vehiclename", true)) { new vehicle = GetVehicleNameByModel(432); new string[125]; format(string, sizeof(string), "You are currently sitting in a %s", vehicle); SendClientMessage(playerid, -1, string); return 1; }
Bad examples..
Function can't be writen like that(KickAll . You must use brackets ().
As for the vehicle name, you're storring it's name in to an integer.
|
Sorry for that mate. I know but idk how i just forgot to add parenthesis in those function's.
Thanks for notifying.
Quote:
Originally Posted by Psymetrix
Don't create variables inside a loop.
Bad:
pawn Код:
stock ExplodeAll() { for(new i = 0; i < MAX_PLAYERS; i++) { new Float:X, Float:Y, Float:Z; GetPlayerPos(i, X, Y, Z); CreateExplosion(X, Y, Z, 7, 100.0); } }
Good:
pawn Код:
stock ExplodeAll() { new Float:X, Float:Y, Float:Z; for(new i = 0; i < MAX_PLAYERS; i++) { GetPlayerPos(i, X, Y, Z); CreateExplosion(X, Y, Z, 7, 100.0); } }
|
Oh yeah.
Thanks for the knowledge , will keep in mind next time! Updating the include!