Hallo,
ich möchte einen Spieler in ein Auto stecken dies soll so geschehen das Spieler A (ich) mich zu Spieler B (Ziel) teleportiere und Spieler B soll in mein Auto kommen.
Ich habe soweit auch einen Code doch mit den in ein Auto stecken funktioniert nicht ganz.
if(strcmp(cmd, "/tp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,F_Gray,"Befehl: /tp [SpielerID/Name]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(IsPlayerInAnyVehicle(playerid)==1 )
{
new susplayer[MAX_PLAYER_NAME];
GetPlayerName(plo, susplayer, sizeof(susplayer));
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
PutPlayerInVehicle(susplayer, tmpcar);//Fehler Zeile
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
SendClientMessage(playerid,F_Red,"Du hast dich Teleportiert");
GetPlayerName(plo, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pAdmin] >= 2000) { }
else {
format(string, sizeof(string), "%s hat sich zu %s geportet.", sendername, giveplayer);
ABroadCast(0x00F5FFFF,string,4);
}
}
else
{
SendClientMessage(playerid,F_Gray,"Du hast nicht genug Rechte!");
}
}
}
else
{
format(string, sizeof(string), "%d ist kein Aktiver Spieler.", plo);
SendClientMessage(playerid,F_Gray, string);
}
}
return 1;
}Hier der Fehlercode:
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,F_Gray,"Befehl: /tp [SpielerID/Name]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(IsPlayerInAnyVehicle(playerid)==1 )
{
new susplayer[MAX_PLAYER_NAME];
GetPlayerName(plo, susplayer, sizeof(susplayer));
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
PutPlayerInVehicle(susplayer, tmpcar);//Fehler Zeile
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
SendClientMessage(playerid,F_Red,"Du hast dich Teleportiert");
GetPlayerName(plo, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pAdmin] >= 2000) { }
else {
format(string, sizeof(string), "%s hat sich zu %s geportet.", sendername, giveplayer);
ABroadCast(0x00F5FFFF,string,4);
}
}
else
{
SendClientMessage(playerid,F_Gray,"Du hast nicht genug Rechte!");
}
}
}
else
{
format(string, sizeof(string), "%d ist kein Aktiver Spieler.", plo);
SendClientMessage(playerid,F_Gray, string);
}
}
return 1;
}Hier der Fehlercode:
Code
C:\Users\Patrick\Desktop\IRP-City\gamemodes\T2R.pwn(33716) : error 035: argument type mismatch (argument 1)
Jeffry: vielleicht weißt du ja was.
@Alle:
Ich komm nicht weiter ich weiß nciht wie man überprüft ob im Auto von playerid noch was frei ist.