07.01.2015, 17:10
this is not working =/
PHP код:
new TrainingObj[MAX_PLAYERS];
#define DIALOG_ID_TRAINING (20)
YCMD:train(playerid, params[], help)
{
#pragma unused params, help
TrainingObj[playerid] = CreatePlayerObject(playerid, 19054, 1332.207397, 2194.804931, 11.023437, 0.0, 0.0, 0.0, 200.0);
SetPlayerPos(playerid, 1332.207397, 2194.804931, 11.023437);
SetPlayerVirtualWorld(playerid, playerid+1);
GivePlayerWeapon(playerid, 34, 500);
return 0;
}
public OnPlayerDisconnect(playerid, reason)
{
if(IsValidPlayerObject(playerid, TrainingObj[playerid]))
DestroyPlayerObject(playerid, TrainingObj[playerid]);
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(weaponid == 34 && hittype == BULLET_HIT_TYPE_OBJECT && hitid == TrainingObj[playerid])
{
DestroyPlayerObject(playerid, TrainingObj[playerid]);
TrainingObj[playerid] = CreatePlayerObject(playerid, 19054, 1332.207397, 2194.804931, 11.023437, 0.0, 0.0, 0.0, 200.0);
SendClientMessage(playerid, -1, "הושמד ויצר חדש");
}
return 1;
}