Hey, ich habe mal eine Frage wegen den Spawn Punkt. Ich Save den AddPlayerClass Code, füge den in Script Speicher es aber wenn ich Ingame bin, bin ich noch immer beim alten.. Kennt jemand eine Lösung?
//Push
Hey, ich habe mal eine Frage wegen den Spawn Punkt. Ich Save den AddPlayerClass Code, füge den in Script Speicher es aber wenn ich Ingame bin, bin ich noch immer beim alten.. Kennt jemand eine Lösung?
//Push
Möglicherweise wird bei OnPlayerSpawn dem Spieler eine andere Position gesetzt (SetPlayerPos).
Möglicherweise wird bei OnPlayerSpawn dem Spieler eine andere Position gesetzt (SetPlayerPos).
Bitte genaue Erklärung.
OnPlayerSpawn wird immer dann aufgerufen, wenn der Spieler gespawnt wird. Das kann durch einen Command mit SpawnPlayer oder durch ein Callback wie z.b OnPlayerRequestClass passieren. Wenn bei OnPlayerSpawn dann SetPlayerPos steht, wird dieser logischerweise an diese Position geportet, da SetPlayerPos danach aufgerufen wird. Also: OnPlayerRequestClass -> Spieler wird gespawnt -> OnPlayerSpawn -> SetPlayerPos -> Endresultat
Es Klappt nicht... Könntest du es vllt über Teamviewer 11 machen?
Kannst du bitte mal dein OnPlayerSpawn posten? Das komplette.
Außerdem wäre es gut zu wissen, wo du spawnst. Ist das ein gewollter Ort?
Zwecks TeamViewer: Die Gründe warum ich auf die Scripting Base verweise
Kannst du bitte mal dein OnPlayerSpawn posten? Das komplette.
Außerdem wäre es gut zu wissen, wo du spawnst. Ist das ein gewollter Ort?
Zwecks TeamViewer: Die Gründe warum ich auf die Scripting Base verweise
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTut] == 0)
{
gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
FreezePlayer(playerid);
AtRegestration[playerid] = 1;
RegistrationStep[playerid] = 1;
//SendClientMessage(playerid, COLOR_YELLOW, " ");
//SendClientMessage(playerid, COLOR_LIGHTRED, " Bist du Männlich oder Weiblich?");
ShowPlayerDialog(playerid,DIALOG_REGSTEP_1,DIALOG_STYLE_MSGBOX,"{00ff00}[{ff0000}Dein erstes Leben{00ff00}]{ffffff}- {00ff00}Eigende Daten","{ffffff}Bist du {ffffff}'{ff0000}Männlich{ffffff}'{ffffff} oder {ffffff}'{ff0000}Weiblich{ffffff}'?{ffffff},\nBitte klicke auf die Option, die auf dich zutrifft.","Männlich","Weiblich");
//----------------
SetPlayerPos(playerid,-1834.8555,18.3044,1061.1436);
SetPlayerFacingAngle(playerid, 4.0557);
SetPlayerInterior(playerid,14);
PlayerInfo[playerid][pInt] = 14;
SetPlayerCameraPos(playerid, -1833.3828,17.7951,1061.3993);
SetPlayerCameraLookAt(playerid,-1834.5859,21.0157,1062.1665);
//ShowPlayerDialog(playerid,DIALOG_REGSTEP_1,DIALOG_STYLE_MSGBOX,"Geschlecht","Bist du Männlich oder Weiblich?","Erstellen","Abbrechen");
//ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login to your account",s,"Login","Cancel");
Alles anzeigen
Das ist eine Funktion "SetPlayerSpawn".
Kannst du bitte mal dein OnPlayerSpawn posten? Das komplette.
Poste bitte die Funktion "OnPlayerSpawn".
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new botname[MAX_PLAYER_NAME];
GetPlayerName(playerid,botname,sizeof(botname));
gPlayerLogged[playerid] = 1;
if(!strcmp(botname,"Nutte",true))
{
SetPlayerSkin(playerid,63);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"Nutte2",true))
{
SetPlayerSkin(playerid,64);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"Nutte3",true))
{
SetPlayerSkin(playerid,152);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"sandra",true))
{
new Text3D:label = Create3DTextLabel("Kassiererin Sandra",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,69);
SetPlayerInterior(playerid,17);
}
if(!strcmp(botname,"angelo",true))
{
new Text3D:label = Create3DTextLabel("Beamter Angelo Merte",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,128);
SetPlayerInterior(playerid,3);
}
if(!strcmp(botname,"angela",true))
{
new Text3D:label = Create3DTextLabel("Kassiererin Angela",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,190);
SetPlayerInterior(playerid,18);
}
if(!strcmp(botname,"carla",true))
{
new Text3D:label = Create3DTextLabel("BS Kassiererin Carla",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.2);
SetPlayerSkin(playerid,205);
SetPlayerInterior(playerid,10);
}
if(!strcmp(botname,"catrina",true))
{
new Text3D:label = Create3DTextLabel("Angestellte Catrina",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,148);
SetPlayerInterior(playerid,0);
}
if(!strcmp(botname,"marta",true))
{
new Text3D:label = Create3DTextLabel("Angestellte Marta",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,150);
SetPlayerInterior(playerid,18);
}
if(!strcmp(botname,"tim",true))
{
new Text3D:label = Create3DTextLabel("Waffenhändler Tim",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,179);
SetPlayerInterior(playerid,4);
}
return 1;
}
if(PlayerInfo[playerid][pGangJailed] == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, -368.4912,-1429.0795,25.7266);
SendClientMessage(playerid, COLOR_LIGHTRED, " Du befindest dich noch im GangJail!");
return 1;
}
ResetPlayerWeapons(playerid);
erstspawn[playerid] = 0;
Alles anzeigen
Kannst du bitte mal dein OnPlayerSpawn posten? Das komplette.
Sonst ist leider nicht ersichtlich, was alles in deinem OnPlayerSpawn passiert.
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new botname[MAX_PLAYER_NAME];
GetPlayerName(playerid,botname,sizeof(botname));
gPlayerLogged[playerid] = 1;
if(!strcmp(botname,"Nutte",true))
{
SetPlayerSkin(playerid,63);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"Nutte2",true))
{
SetPlayerSkin(playerid,64);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"Nutte3",true))
{
SetPlayerSkin(playerid,152);
SetPlayerInterior(playerid,2);
}
if(!strcmp(botname,"sandra",true))
{
new Text3D:label = Create3DTextLabel("Kassiererin Sandra",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,69);
SetPlayerInterior(playerid,17);
}
if(!strcmp(botname,"angelo",true))
{
new Text3D:label = Create3DTextLabel("Beamter Angelo Merte",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,128);
SetPlayerInterior(playerid,3);
}
if(!strcmp(botname,"angela",true))
{
new Text3D:label = Create3DTextLabel("Kassiererin Angela",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,190);
SetPlayerInterior(playerid,18);
}
if(!strcmp(botname,"carla",true))
{
new Text3D:label = Create3DTextLabel("BS Kassiererin Carla",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.2);
SetPlayerSkin(playerid,205);
SetPlayerInterior(playerid,10);
}
if(!strcmp(botname,"catrina",true))
{
new Text3D:label = Create3DTextLabel("Angestellte Catrina",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,148);
SetPlayerInterior(playerid,0);
}
if(!strcmp(botname,"marta",true))
{
new Text3D:label = Create3DTextLabel("Angestellte Marta",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,150);
SetPlayerInterior(playerid,18);
}
if(!strcmp(botname,"tim",true))
{
new Text3D:label = Create3DTextLabel("Waffenhändler Tim",0x00C5FFFF,-29.1652,-186.8162,1003.5469,30.0,0);
Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.1);
SetPlayerSkin(playerid,179);
SetPlayerInterior(playerid,4);
}
return 1;
}
if(PlayerInfo[playerid][pGangJailed] == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, -368.4912,-1429.0795,25.7266);
SendClientMessage(playerid, COLOR_LIGHTRED, " Du befindest dich noch im GangJail!");
return 1;
}
ResetPlayerWeapons(playerid);
erstspawn[playerid] = 0;
//=================== GANGZONEN =========================================
//grove
if(BInfo[GSBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,GSZONE,0x00000067);
}
if(BInfo[GSBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,GSZONE,0xFFFFFF67);
}
if(BInfo[GSBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,GSZONE,0x00890067);
}
if(BInfo[GSBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,GSZONE,0xFF00FF67);
}
if(BInfo[GSBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,GSZONE,0xFFFF0067);
}
if(BInfo[GSBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,GSZONE,0x00FFFF67);
}
//LCN
if(BInfo[LCNBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,LCNZONE,0x00000067);
}
if(BInfo[LCNBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,LCNZONE,0xFFFFFF67);
}
if(BInfo[LCNBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,LCNZONE,0x00890067);
}
if(BInfo[LCNBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,LCNZONE,0xFF00FF67);
}
if(BInfo[LCNBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,LCNZONE,0xFFFF0067);
}
if(BInfo[LCNBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,LCNZONE,0x00FFFF67);
}
//Ballas
if(BInfo[BLBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0x00000067);
}
if(BInfo[BLBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0xFFFFFF67);
}
if(BInfo[BLBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0x00890067);
}
if(BInfo[BLBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0xFF00FF67);
}
if(BInfo[BLBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0xFFFF0067);
}
if(BInfo[BLBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,BALLASZONE,0x00FFFF67);
}
//YAKUZA
if(BInfo[YAKBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0x00000067);
}
if(BInfo[YAKBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0xFFFFFF67);
}
if(BInfo[YAKBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0x00890067);
}
if(BInfo[YAKBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0xFF00FF67);
}
if(BInfo[YAKBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0xFFFF0067);
}
if(BInfo[YAKBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,YAKUZAZONE,0x00FFFF67);
}
//AZTEN
if(BInfo[AZTBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0x00000067);
}
if(BInfo[AZTBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0xFFFFFF67);
}
if(BInfo[AZTBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0x00890067);
}
if(BInfo[AZTBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0xFF00FF67);
}
if(BInfo[AZTBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0xFFFF0067);
}
if(BInfo[AZTBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,AZTENZONE,0x00FFFF67);
}
//BC
if(BInfo[BCBASEOWNER]==5)
{
GangZoneShowForPlayer(playerid,BCZONE,0x00000067);
}
if(BInfo[BCBASEOWNER]==6)
{
GangZoneShowForPlayer(playerid,BCZONE,0xFFFFFF67);
}
if(BInfo[BCBASEOWNER]==12)
{
GangZoneShowForPlayer(playerid,BCZONE,0x00890067);
}
if(BInfo[BCBASEOWNER]==13)
{
GangZoneShowForPlayer(playerid,BCZONE,0xFF00FF67);
}
if(BInfo[BCBASEOWNER]==14)
{
GangZoneShowForPlayer(playerid,BCZONE,0xFFFF0067);
}
if(BInfo[BCBASEOWNER]==15)
{
GangZoneShowForPlayer(playerid,BCZONE,0x00FFFF67);
}
GangZoneShowForAll(GSZONE,0x00890067);
GangZoneShowForPlayer(playerid,LCNZONE,0x00000067);
GangZoneShowForPlayer(playerid,BALLASZONE,0xFF00FF67);
GangZoneShowForPlayer(playerid,BCZONE,0xFFFF0067);
GangZoneShowForPlayer(playerid,AZTENZONE,0x00FFFF67);
GangZoneShowForPlayer(playerid,YAKUZAZONE,0xFFFFFF67);
GangZoneShowForPlayer(playerid,NoDMBSN,COLOR_RED);
GangZoneShowForPlayer(playerid,NoDMNOOB,COLOR_RED);
//============================================================================
if(PlayerInfo[playerid][pTot] == 1 && FirstSpawn[playerid] == 0 && PlayerInfo[playerid][WantedTot]==0 && PlayerInfo[playerid][pJailed]==0)
{
SetPlayerPos(playerid, ppX, ppY, ppZ);
SetTimerEx("Spawn",1000,false,"i",playerid);
TogglePlayerControllable(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid,PlayerInfo[playerid][pChar]);
return 1;
}
/*if(PlayerInfo[playerid][DM]==1)
{
new DMSpawn;
DMSpawn = random(sizeof(DMSpawns));
SetPlayerPos(playerid,DMSpawns[DMSpawn][0],DMSpawns[DMSpawn][1],DMSpawns[DMSpawn][2],DMSpawns[DMSpawn][3],DMSpawns[DMSpawn][4]);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,34,500);
SetPlayerHealth(playerid,100);
SetTimerEx("DMSPAWN",100,0,"i",playerid);
}*/
M_OnPlayerSpawn(playerid);
TextDrawShowForPlayer(playerid,Textdraw1);
SetPlayerHealth(playerid,100);
PlayerInfo[playerid][WantedTot]=0;
//InitLockDoors(playerid);
STDPlayer[playerid] = 0;
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
if (gTeam[playerid] == 4) //medic / criminal reset team
{
gTeam[playerid] = 3;
}
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich voher einloggen oder dir einen Account erstellen! ***");
Kick(playerid);
return 1;
/*
if(gPlayerAccount[playerid] == 1)
{
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, 0);
}
else if(gPlayerAccount[playerid] == 0)
{
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, 0);
}
return 1;
*/
}
if(ObdachlosenSpawn[playerid] == 1)
{
SetPlayerPos(playerid,318.564971,1118.209960,1083.882812);
SetPlayerInterior(playerid,5);
return 1;
}
if(PlayerInfo[playerid][pfight] == 1)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_NORMAL);
}
else if(PlayerInfo[playerid][pfight] == 2)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_BOXING);
}
else if(PlayerInfo[playerid][pfight] == 3)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_KUNGFU);
}
else if(PlayerInfo[playerid][pfight] == 4)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_KNEEHEAD);
}
else if(PlayerInfo[playerid][pfight] == 5)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_GRABKICK);
}
else if(PlayerInfo[playerid][pfight] == 6)
{
SetPlayerFightingStyle(playerid,FIGHT_STYLE_ELBOW);
}
if(AtClothes[playerid] == 1)
{
PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
AtClothes[playerid] = 0;
}
if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
//SetPlayerWeapons(playerid);
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
PlayerFixRadio(playerid);
for(new i = 0; i < sizeof(Turfs); i++)
{
GangZoneShowForPlayer(playerid, i, TurfInfo[i][zColor]);
Alles anzeigen
Da du es anscheinend nicht auf die Reihe bekommst die komplette Funktion zu posten, werde ich nach 3 Nachfragen nicht weiter danach fragen.
Zudem sieht es, den Teilen die du gepostet hast danach aus, dass dort weitere Funktionen aufgerufen werden, daher ist eine Nachvollziehbarkeit kaum möglich.
Setze dich bitte mit dem Ersteller des Gamemodes in Verbindung.