Moin wenn ich die H taste drücke soll sich das tor öffnen soweit sogut tut es auch solange ich zu fuss bin aber es soll auch gehen wenn ich im auto sitze.
Hier mein code:
Code
if (newkeys & KEY_CTRL_BACK) // H-TASTE
{
if(GetPVarInt(playerid,"StateChange") != 0) return SendClientMessage(playerid,COLOR_RED,"WARTE 2Sek");
{
if(IsPlayerInRangeOfPoint(playerid,1.5,METHINT_KOCHPOINT)) // WOHNWAGEN METHKÜCHE KOCHEN
{
new string[256];
format(string,sizeof(string),"\n\n\n{FF32DB}Psyedo{FFFFFF}: \t{FF32DB}5/{FFFFFF}%ig\n{FF32DB}Frostschutz{FFFFFF}: \t{FF32DB}200/{FFFFFF}%iml\n{FF32DB}R.Phosphor{FFFFFF}: \t{FF32DB}10/{FFFFFF}%ig\n\n\n\n{FF32DB}Benutze {FFFFFF}/abbrechen {FF32DB}um den Vorgang abzubrechen",tInfo[playerid][pseudo],tInfo[playerid][frostschutz],tInfo[playerid][redphosphor]);
ShowPlayerDialog(playerid,DIALOG_METHINFO,DIALOG_STYLE_MSGBOX,"{FF32DB}Willst du Meth Kochen?",string,"{FF32DB}Kochen","{FF32DB}Nein");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,2,METHINT_SPAWN))//WOHNWAGEN VERLASSEN
{
for(new i=0; i<sizeof(cInfo); i++)
{
new pworld = GetPlayerVirtualWorld(playerid);
if(pworld != cInfo[i][db_id]) continue;
new Float:r,Float:x,Float:y,Float:z;
GetVehiclePos(cInfo[i][c_id],x,y,z);
GetVehicleZAngle(cInfo[i][c_id],r);
SetPlayerPos(playerid,x,y-1.5,z);
SetPlayerFacingAngle(playerid,r);
SetPlayerVirtualWorld(playerid,0);
SendClientMessage(playerid,COLOR_RED,"METH SCHUPPEN VERLASSEN");
SetPVarInt(playerid,"StateChange",1);
SetTimerEx("StateChangeTimer",2000,false,"i",playerid);
break;
}
}
for(new k=0; k<sizeof(gInfo); k++)// Gate Öffnen mit hupe
{
if(!IsPlayerInRangeOfPoint(playerid,20,gInfo[k][g_closex],gInfo[k][g_closey],gInfo[k][g_closez])) continue;
if(gInfo[k][g_fID] != sInfo[playerid][fraktion]) continue;
{
MoveDynamicObject(objectGate[k],gInfo[k][g_openx],gInfo[k][g_openy],gInfo[k][g_openz],gInfo[k][g_speed],gInfo[k][g_openrx],gInfo[k][g_openry],gInfo[k][g_openrz]);
SendClientMessage(playerid,COLOR_RED,"[!]{FFFFFF}Gate geöffnet{FF0000}[!]");
SetPVarInt(playerid,"GateInUse",1);
SetTimerEx("GateCloseTimer",5000,false,"ii",playerid,k);
break;
}
}
for(new i=0; i<sizeof(iInfo); i++)//INFO i mit Dialogen
{
if(IsPlayerInRangeOfPoint(playerid,1.5,iInfo[i][info_x],iInfo[i][info_y],iInfo[i][info_z]))
{
ShowPlayerDialog(playerid,iInfo[i][infodialog],iInfo[i][idialog_style],iInfo[i][idialog_caption],iInfo[i][idialog_text],iInfo[i][idialog_button1],iInfo[i][idialog_button2]);
SetPVarInt(playerid,"StateChange",1);
SetTimerEx("StateChangeTimer",2000,false,"i",playerid);
break;
}
}
for(new i=0; i<sizeof(cInfo); i++)//WOHNWAGEN BETRETEN
{
if(cInfo[i][c_model] != 508) continue;
{
new Float:x,Float:y,Float:z;
GetVehiclePos(cInfo[i][c_id],x,y,z);
if(!IsPlayerInRangeOfPoint(playerid,5,x,y+1,z)) continue;
SetPlayerPos(playerid,METHINT_SPAWN);
SetPlayerVirtualWorld(playerid,cInfo[i][db_id]);
SendClientMessage(playerid,COLOR_RED,"METH SCHUPPEN BETRETEN");
SetPVarInt(playerid,"StateChange",1);
SetTimerEx("StateChangeTimer",2000,false,"i",playerid);
break;
}
}
}
return 1;
}
Alles anzeigen