Hey,
ich weiß nicht wie ich das Abfragen soll ob er im Auto1 ist...
Codes:
stock Register(playerid,key[])
{
new Spielerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
dini_Create(Spielerdatei);
dini_Set(Spielerdatei,"Passwort",key);
SetPlayerScore(playerid,1);
SetPVarInt(playerid,"loggedin",1);
SetPVarInt(playerid,"Adminlevel",0);
SetPVarInt(playerid,"Geschlecht",0);
SetPVarInt(playerid,"Alter",0);
SetPVarInt(playerid,"Geld",10000);
SetPVarInt(playerid,"Tutorial",0);
SetPVarInt(playerid,"Fahrrad",0);
SetPVarInt(playerid,"Fahrradstatus",0);
SetPVarInt(playerid,"Autoschein",0);
SetPVarInt(playerid,"Personalausweis",0);
SetPVarInt(playerid,"Auto1",0);
SetPVarInt(playerid,"Auto2",0);
SetPVarInt(playerid,"Auto3",0);
SetPVarInt(playerid,"Auto1lock",0);
SetPVarInt(playerid,"Auto2lock",0);
SetPVarInt(playerid,"Auto3lock",0);
GivePlayerMoney(playerid,10000);
return 1;
}
new Auto1[MAX_PLAYERS];
new Auto2[MAX_PLAYERS];
new Auto3[MAX_PLAYERS];
ocmd:carlock(playerid,params[])
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(Auto1[playerid], X, Y, Z);
GetVehiclePos(Auto2[playerid], X, Y, Z);
GetVehiclePos(Auto3[playerid], X, Y, Z);
if(GetPVarInt(playerid,"Auto1") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,5,X,Y,Z))
{
if(GetPVarInt(playerid,"Auto1lock") == 1)
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~g~geoeffnet",3000, 5);
SetPVarInt(playerid,"Auto1lock",0);
SetVehicleLock(Auto1[playerid],0);
return 1;
}
else
{
PlayerPlaySound(playerid,1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~r~verschlossen",3000, 5);
SetPVarInt(playerid,"Auto1lock",1);
SetVehicleLock(Auto1[playerid],1);
return 1;
}
}
}
if(GetPVarInt(playerid,"Auto2") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,5,X,Y,Z))
{
if(GetPVarInt(playerid,"Auto2lock") == 1)
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~g~geoeffnet",3000, 5);
SetPVarInt(playerid,"Auto2lock",0);
SetVehicleLock(Auto2[playerid],0);
return 1;
}
else
{
PlayerPlaySound(playerid,1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~r~verschlossen",3000, 5);
SetPVarInt(playerid,"Auto2lock",1);
SetVehicleLock(Auto2[playerid],1);
return 1;
}
}
}
if(GetPVarInt(playerid,"Auto3") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,5,X,Y,Z))
{
if(GetPVarInt(playerid,"Auto3lock") == 1)
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~g~geoeffnet",3000, 5);
SetPVarInt(playerid,"Auto3lock",0);
SetVehicleLock(Auto3[playerid],0);
return 1;
}
else
{
PlayerPlaySound(playerid,1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~w~Auto ~r~verschlossen",3000, 5);
SetPVarInt(playerid,"Auto3lock",1);
SetVehicleLock(Auto3[playerid],1);
return 1;
}
}
}
return 1;
}
Ich mag jetzt einen /parken befehl aber ich weiß nicht wie ich abfragen soll ob er im Auto1 ist (Carslot 1) oder Auto2 etc...
MfG