27.07.2011, 21:59
One small thing that bothers me, what's the model variable actually for or how is it assigned?
Also, a small thing to make your code better would be using a switch statement there.
Something to make your code better structured (for some eyes that is):
There's some useless returning as well...
Also, a small thing to make your code better would be using a switch statement there.
pawn Код:
switch(model)
{
case 534:
{
}
case 533:
{
}
//...
}
pawn Код:
// instead of this:
if(response)
{
switch(model)
{
// ...
}
}
// act like this:
if(!response)
return true;
switch(model)
{
// ...
}
pawn Код:
if(PlayerData[playerid][pcar] == -1)
{
SendClientMessage(playerid, COLOR_GREEN, "You buy REMINGTON=1");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "You buy REMINGTON=2");
return 1; // <-- useless return,
}
return 1; // <-- this one will do the job