27.08.2010, 12:12
How do i make the player who got jailed unkillable with this jail cmd? is it even possible?
Or do i need a timer who checks the players heal and heal him when loose health? If.. how?
Or do i need a timer who checks the players heal and heal him when loose health? If.. how?
Код:
if(strcmp(cmd, "/Jail", true) == 0) { if(PlayerBase[playerid][pAdmin] >= 1) { tmp = strtok(cmdtext , idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREEN, "Use: /Jail [playerid]/name] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; while ((idx < length) && ((idx - offset) < (sizeof(tmp) - 1))) { tmp[idx - offset] = cmdtext[idx]; idx++; } tmp[idx - offset] = EOS; if(!strlen(tmp)) { SCM(playerid, COLOR_GREEN, "Use: /Jail [playerid/name] [Reason]]"); return 1; } if(IsPlayerConnected(giveplayerid)) { GetPlayerName(playerid, sendare, sizeof(sendare)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); SetPlayerPos(giveplayerid, 412.99816894531,2543.0656738281,26.244613647461); ResetPlayerWeapons(giveplayerid); format(text, sizeof(text), "You Just Jailed %s , Reason: %s", giveplayer, tmp); SCM(playerid, COLOR_RED, text); format(text, sizeof(text), "Admin %s Jailed %s , Reason:%s", sendare, giveplayer, tmp); SendClientMessageToAll(COLOR_RED, text); } else{SCM(playerid, COLOR_RED, "(That player is not online!)");} } else(SCM(playerid, COLOR_RED, "You Are Not An Admin!")); return 1; }