Hallo liebe Scripter:D
Ich habe irgendetwas falsch an diesem Befehl gemacht.. Ich weiß nur nicht was..
Kann mir jemand helfen dne fehler zu finden?
if(strcmp(cmd, "/wiederbeleben", true) == 0 || strcmp(cmd, "/rea", true) == 0 || strcmp(cmd, "/reanimieren", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pTot] == 1 && IsPlayerInRangeOfPoint(playerid,5.0,PlayerInfo[i][pTx],PlayerInfo[i][pTy],PlayerInfo[i][pTz]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wiederbeleben [playerid/PartOfName]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "Du hast %s, wiederbelebt!",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
format(string, 256, "Arzt %s hat dich wiederbelebt!",sendername);
SendClientMessage(i, COLOR_LIGHTGREEN, string);
PlayerInfo[giveplayerid][pTot] = 0;
pIstTot[giveplayerid] = 0;//
SetPlayerInterior(i,GetPlayerInterior(giveplayerid));
SetPlayerPos(giveplayerid,PlayerInfo[giveplayerid][pTx],PlayerInfo[giveplayerid][pTy],PlayerInfo[giveplayerid][pTz]);
SetCameraBehindPlayer(giveplayerid);
DestroyPickup(TotenKopf[giveplayerid][0]);
TogglePlayerControllable(giveplayerid,1);
UnFreezePlayer(giveplayerid);
PlayerInfo[giveplayerid][pTx] = 0.0;
PlayerInfo[giveplayerid][pTy] = 0.0;
PlayerInfo[giveplayerid][pTz] = 0.0;
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
SetPlayerHealth(giveplayerid,15.0);
new revivelohn;
revivelohn = 1400 + random(150);
GivePlayerMoney(playerid, revivelohn);
GivePlayerMoney(giveplayerid, -revivelohn);
format(string, 256, "%d$ für erfolgreiches wiederbeleben.",revivelohn);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
format(string, 256, "Du bezahlst %d$ für deine Wiederbelebung.",revivelohn);
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Arzt!");
}
}
return 1;
}
Der Fehler ist, ich kann keinen Wiederbeleben und wenn ich jemanden töte dann spawnen die in deren Base or am Neulingsspawn...