04.03.2011, 13:23
they both compile just not sure if the braces are needed,Please tell me what way is better..
A:
B:
A or B?
Thanks
A:
pawn Код:
CMD:cuff(playerid, params[])
{
new targetid;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, "U", targetid)) return SendClientMessage(playerid,RED, "USAGE: /cuff [id]");
{
if(gTeam[playerid] != CLASS_COPS) return SendClientMessage(playerid, RED,"Only Cops Can Cuff People!");
{
if(targetid == playerid) return SendClientMessage(playerid, RED, "You Cant Cuff Yourself!");
{
if (!ProxDetectorS(7.5, playerid, targetid)) return SendClientMessage(playerid, RED, "The Player Is Not Close Enough!");
{
if(GetPlayerWantedLevel(targetid) < 4) return SendClientMessage(playerid, RED, "That Player Is Not Wanted!");
{
if(IsPlayerInAnyVehicle(targetid) && IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You Cant Cuff Players Through Vehicles!");
{
if(gTeam[targetid] == CLASS_COPS || gTeam[targetid] == CLASS_MEDIC) return SendClientMessage(playerid, RED, "You Cant Cuff Other Cops Or Medics!");
else
{
GameTextForPlayer(targetid, "\n\n\n~r~Cuffed!", 2500, 5);
GameTextForPlayer(playerid, "\n\n\n~g~Suspect Cuffed!", 2500, 5);
TogglePlayerControllable(targetid, false);
}
}
}
}
}
}
}
return true;
}
pawn Код:
CMD:cuff(playerid, params[])
{
new targetid;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, "U", targetid)) return SendClientMessage(playerid,RED, "USAGE: /cuff [id]");
if(gTeam[playerid] != CLASS_COPS) return SendClientMessage(playerid, RED,"Only Cops Can Cuff People!");
if(targetid == playerid) return SendClientMessage(playerid, RED, "You Cant Cuff Yourself!");
if (!ProxDetectorS(7.5, playerid, targetid)) return SendClientMessage(playerid, RED, "The Player Is Not Close Enough!");
if(GetPlayerWantedLevel(targetid) < 4) return SendClientMessage(playerid, RED, "That Player Is Not Wanted!");
if(IsPlayerInAnyVehicle(targetid) && IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You Cant Cuff Players Through Vehicles!");
if(gTeam[targetid] == CLASS_COPS || gTeam[targetid] == CLASS_MEDIC) return SendClientMessage(playerid, RED, "You Cant Cuff Other Cops Or Medics!");
else
{
GameTextForPlayer(targetid, "\n\n\n~r~Cuffed!", 2500, 5);
GameTextForPlayer(playerid, "\n\n\n~g~Suspect Cuffed!", 2500, 5);
TogglePlayerControllable(targetid, false);
}
return true;
}
Thanks