13.03.2010, 16:20
Indent your work better, and don't add 'IsPlayerConnected' to command especially since a player can't type a command if he's not connected!
pawn Код:
if(strcmp(cmd, "/BreakIn", true) == 0)
{
if(Toolkit[playerid] == 1)
{
new Float:x,Float:y,Float:z;
for(new vehicleid;vehicleid<MAX_VEHICLES;vehicleid++)
{
GetVehiclePos(vehicleid,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z))
{
switch(VehicleInfo[vehicleid][vLock])
{
case 0: Break[playerid] = 20;
case 1: Break[playerid] = 40;
case 2: Break[playerid] = 60;
default: Break[playerid] = 80;
}
BreakingInCount(playerid, vehicleid);
return 1;
}
}
return SendClientMessage(playerid,0xFFFFFFFF,"You're not near a vehicle.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have a Toolkit!");
return 1;
}
return 1;
}