14.06.2013, 17:34
Hey guys, I've been trying to let zombies infect with a punch but I couldn't make it work, I wonder how I could make it actually work.
The codes
under OnPlayerKeyStateChange
The codes
under OnPlayerKeyStateChange
pawn Код:
if((newkeys < oldkeys) && PlayerInfo[playerid][pZombie] == 1)
{
if(oldkeys - newkeys == KEY_FIRE)
{
new playerb;
new string[128];
if(PlayerInfo[playerb][pZombie] == 1) return 1;
if(Infected[playerb] == 1) return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}This player is already infected.");
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(!IsPlayerNearPlayer(playerid, playerb, 1.0))
{
GameTextForPlayer(playerb,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Infected~n~~w~Get An ~g~Antidote",3000,4);
Infected[playerb] = 1;
PlayerInfo[playerid][pInfects] += 1;
SetTimerEx("InfectedPlayer", 3000, true, "i", playerb);
format(string, sizeof(string), "* %s scratches %s, infecting them with the zombie virus.", RPN(playerid), RPN(playerb));
ProxDetector(30, playerid, string, COLOR_PURPLE);
}
}
}