13.04.2010, 20:08
try this :
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0)) {
if(newkeys == KEY_JUMP)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
EnterCarTime[playerid] += 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!");
return 1;
}
}
if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8)
{
if(PlayerInfo[playerid][pC4Used] == 0)
{
CreateExplosion(bx, by, bz, 7, 4);
PickUpC4(playerid);
PlayerInfo[playerid][pC4Used] = 1;
}
}
new string[128];
if(editingcdvehpos[playerid])
{
TogglePlayerControllable(playerid, false);
format(string,256,"Is this the new position you want?.");
ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel");
}
if(editingcdvehnew[playerid])
{
TogglePlayerControllable(playerid, false);
format(string,256,"Is this the new position you want?.");
ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel");
}
}
}
return 1;
}

