Originally Posted by Mike_Peterson
This is the code hes talking about
pawn Код:
dcmd_kill(playerid,params[]) { #pragma unused params if(IsCuffed[playerid] == 1) { SendClientMessage(playerid,COLOR_ERROR,"You cannot kill yourself while handcuffed. How could that be possible?"); return 1; } if(IsKidnapped[playerid] == 1) { SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command."); return 1; } if(IsSpawned[playerid] == 0) { SendClientMessage(playerid,COLOR_ERROR,"You are already dead, why on earth would you want to kill yourself twice?"); return 1; } if(GetPlayerWantedLevel(playerid) >= 1) { SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you have a wanted level."); return 1; } if(JailTime[playerid] >= 1) { SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you are in jail."); return 1; } HasUsedKill[playerid] =1; SetPlayerHealth(playerid,0); return 1; }
Isn't this more compact?
pawn Код:
dcmd_kill(playerid,params[]) { #pragma unused params if(IsCuffed[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot kill yourself while handcuffed. How could that be possible?"); if(IsKidnapped[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command."); if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,COLOR_ERROR,"You are already dead, why on earth would you want to kill yourself twice?"); if(GetPlayerWantedLevel(playerid) >= 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you have a wanted level."); if(JailTime[playerid] >= 1) return SendClientMessage(playerid,COLOR_ERROR,"You cannot use /kill to kill yourself while you are in jail."); HasUsedKill[playerid] = 1; SetPlayerHealth(playerid,0.0); return 1; }
Btw, just keep using dcmd no matter what people say, I use it too, works great for me. only when you're having difficulties, switch to zcmd(no me gusta).
|