Hey Leute,
Habe vor ein Paar Tagen mit meinem Selfmade angefangen! Jetzt habe ich nur ein Problem! Wenn man stirbt bzw. spawnt bekommt man einen crash!
hier mal onplayerspawn und onplayerdeath
public OnPlayerSpawn(playerid)
{
ClearAnimations(playerid);
UpdateBank(playerid);
DestroyPickup(Leben[playerid]);
TextDrawShowForPlayer(playerid, Uhr);
TextDrawShowForPlayer(playerid, Punkte);
TextDrawShowForPlayer(playerid, BankGeld[playerid]);
TextDrawShowForPlayer(playerid, Heal[playerid]);
TextDrawShowForPlayer(playerid, Armour[playerid]);
SetPlayerSkin(playerid, skin[playerid]);
/*
SetPlayerSkillLevel(playerid, 0, 1);
SetPlayerSkillLevel(playerid, 1, 1);
SetPlayerSkillLevel(playerid, 2, 1);
SetPlayerSkillLevel(playerid, 3, 1);
SetPlayerSkillLevel(playerid, 4, 1);
SetPlayerSkillLevel(playerid, 5, 1);
SetPlayerSkillLevel(playerid, 6, 1);
SetPlayerSkillLevel(playerid, 7, 1);
SetPlayerSkillLevel(playerid, 8, 1);
SetPlayerSkillLevel(playerid, 9, 1);
SetPlayerSkillLevel(playerid, 10, 1);
*/
if(IsTerrorist(playerid))
{
SetPlayerPos(playerid,TSPAWN);
SetPlayerColor(playerid, COLOR_T);
GivePlayerWeapon(playerid, 4, 500); //Messer
GivePlayerWeapon(playerid, 22, 120); //9mm
return 1;
}
else if(IsCounterTerrorist(playerid))
{
SetPlayerPos(playerid,CTSPAWN);
SetPlayerColor(playerid, COLOR_CT);
GivePlayerWeapon(playerid, 4, 500); //Messer
GivePlayerWeapon(playerid, 23, 120); //9mm Silenced
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
Leben[playerid] = CreatePickup(1240, 1, pX, pY, pZ ,-1);
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
pInfo[killerid][Kills]++;
pInfo[playerid][Tode]++;
Defusekit[playerid] = 0;
SendDeathMessage(killerid, playerid, reason);
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -1000);
GameTextForPlayer(playerid, "~r~-1000$" , 3000 , 3);
GameTextForPlayer(killerid, "~g~+1000$" , 3000 , 3);
ResetPlayerWeapons(playerid);
TextDrawHideForPlayer(playerid, Heal[playerid]);
TextDrawHideForPlayer(playerid, Punkte);
TextDrawHideForPlayer(playerid, Armour[playerid]);
TextDrawHideForPlayer(playerid, BankGeld[playerid]);
TextDrawHideForPlayer(playerid, Uhr);
if(IsTerrorist(killerid))
{
tpunkte++;
UpdatePunkte();
return 1;
}
else if(IsCounterTerrorist(killerid))
{
ctpunkte++;
UpdatePunkte();
return 1;
}
return 1;
}
Hoffe ihr findet den Fehler!
mfg Eric
//EDIT eingerückt!
//PUSH Findet denn niemand hier irgendein Fehler? Soviele Möglichkeiten gibts ja nich, nur finde ich ihn leider auch net ;D