Hallo Leute ,
also ich habe ein Problem , dass ich es einfach nicht hinbekomme , einen Wechselnden Skin und Spawn zu machen.
Denn es ist wircklich Zufall , ob es funktioniert ode nicht , denn manchmal versetzt er ein nur in das andere Team , wenn man den Command eingibt , aber man bekommt den Skin nicht, und die PlayerColor verändert sich nicht.
Also , ob ihr daraus es vielleicht richtig machen könntet.
Team 1 :
if(strcmp(cmd, "/Teamrot", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new string[256];
PlayerInfo[playerid][pTeam] = 1;
SetPlayerColor(playerid,COLOR_RED);
OnPlayerDataSave(playerid);
new zufall = random(3);
if(zufall == 1) {
SetPlayerPos(playerid, -131.2876,-87.3749,3.1181);
SetPlayerSkin(playerid,28);
SetSpawnInfo(playerid,0,28,-131.2876,-87.3749,3.1181,0,0,0,0,0,0,0);
}
else if(zufall == 2) {
SetPlayerPos(playerid, -146.7958,-95.9391,3.1181);
SetPlayerSkin(playerid,30);
SetSpawnInfo(playerid,0,30,-146.7958,-95.9391,3.1181,0,0,0,0,0,0,0);
}
else if(zufall == 3) {
SetPlayerPos(playerid, -137.5432,-98.0654,3.1181);
SetPlayerSkin(playerid,143);
SetSpawnInfo(playerid,0,143,-137.5432,-98.0654,3.1181,0,0,0,0,0,0,0);
}
if(GetPlayerSkin(playerid) != 28 || 30 || 143) {
SetPlayerSkin(playerid,30);
SetPlayerPos(playerid, -146.7958,-95.9391,3.1181);
SetSpawnInfo(playerid,0,30,-146.7958,-95.9391,3.1181,0,0,0,0,0,0,0);
format(string, sizeof(string), "[Info:] Skin: %d Team Terroristen", GetPlayerSkin(playerid));
SendClientMessage(playerid, COLOR_RED, string);
} else {
format(string, sizeof(string), "[Info:] Skin: %d Team Terroristen", GetPlayerSkin(playerid));
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
}
}
Team 2
if(strcmp(cmd, "/Teamblau", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new string[256];
PlayerInfo[playerid][pTeam] = 2;
SetPlayerColor(playerid,COLOR_BLUE);
OnPlayerDataSave(playerid);
new zufall = random(3);
if(zufall == 1) {
SetPlayerPos(playerid, -5.1574,-12.6715,3.1172);
SetPlayerSkin(playerid,281);
SetSpawnInfo(playerid,0,281,-5.1574,-12.6715,3.1172,0,0,0,0,0,0,0);
}
else if(zufall == 2) {
SetPlayerPos(playerid, 9.0554,-19.8566,3.1172);
SetPlayerSkin(playerid,285);
SetSpawnInfo(playerid,0,285,9.0554,-19.8566,3.1172,0,0,0,0,0,0,0);
}
else if(zufall == 3) {
SetPlayerPos(playerid, -3.6320,-5.9046,3.1172);
SetPlayerSkin(playerid,286);
SetSpawnInfo(playerid,0,286,-3.6320,-5.9046,3.1172,0,0,0,0,0,0,0);
}
if(GetPlayerSkin(playerid) != 281 || 285 || 286) {
SetPlayerSkin(playerid,286);
SetPlayerPos(playerid, -3.6320,-5.9046,3.1172);
SetSpawnInfo(playerid,0,286,-3.6320,-5.9046,3.1172,0,0,0,0,0,0,0);
format(string, sizeof(string), "[Info:] Skin: %d Team Counter Terroristen", GetPlayerSkin(playerid));
SendClientMessage(playerid, COLOR_BLUE, string);
} else {
format(string, sizeof(string), "[Info:] Skin: %d Team Counter Terroristen", GetPlayerSkin(playerid));
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
Währe wircklich nett von euch