03.06.2012, 19:13
(
Last edited by cloudysky; 03/06/2012 at 10:40 PM.
)
Fixed
command(bite, playerid, params[])
{
new string[128];
new player[MAX_PLAYER_NAME];
new humanplayer[MAX_PLAYER_NAME];
new human;
// humans don't bite...
if(sscanf(params, "u", zombie)) return SendClientMessage(playerid, COLOUR_WHITE, "HINT: /bite [Playerid]");
if(!IsPlayerConnected(zombie)) return SendClientMessage(playerid, COLOUR_WHITE, "HINT: You can't bite someone who isn't online!");
new Float: bx, Float: by, Float: bz,health;
GetPlayerPos(human, bx, by, bz );
if(IsPlayerInRangeOfPoint(playerid, 10, bx, by, bz))
{
GetPlayerName(playerid, player, sizeof(player);
GetPlayerName(human, humanplayer, sizeof(humanplayer);
GetPlayerHealth(human, health);
SetPlayerHealth(human,health -10);
format(string, sizeof(string),"[WARNING] You have been biten by %s, you better get to the CDC or try your luck in the hospital!", player,humanplayer);
SendClientMessage(human, COLOUR_GREEN, string );
format(string2, sizeof(string2),"[NOTE] You have biten %s", humanplayer);
SendClientMessage(playerid, COLOUR_RED, string2 );
SaveUser(human);
}
return 1;
}
|
System not initialised |
|
#include <sscanf2> |
|
native sscanf(const data[], const format[], {Float,_}:...); native unformat(const data[], const format[], {Float,_}:...) = sscanf; native SSCANF_Init(players, invalid, len); native SSCANF_Join(playerid, const name[], npc); native SSCANF_Leave(playerid); |