16.04.2012, 16:15
Having trouble with this, it works to enter but not exit the garage, and its sends the message "this is garage belongs to..." after you enter instead of when your player name isn't the right one...any ideas?
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if((newkeys == KEY_FIRE)&&(oldkeys != KEY_FIRE) && (IsPlayerInDynamicCP(playerid, Garage2Enter))) if(strcmp(name,"Timmy_Hernandez")==0) { if(IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid), -1775.9374, 1411.8651, 826.5721);//vehicle garage enter SendClientMessage(playerid,0x1E90FFAA,"Welcome to your garage, Timmy_Hernandez!"); } else { SetPlayerPos(playerid, -1775.9374, 1411.8651, 826.5721);//player garage enter SendClientMessage(playerid,0x1E90FFAA,"Welcome to your garage, Timmy_Hernandez!"); } if((newkeys == KEY_FIRE)&&(oldkeys != KEY_FIRE) && (IsPlayerInDynamicCP(playerid, Garage2Exit))) { if(IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid), -1786.8834, 1403.2548, 6.6779);//vehicle garage exit } else { SetPlayerPos(playerid, -1786.8834, 1403.2548, 6.6779);//player garage exit } } else { SendClientMessage(playerid,0xD2691EAA,"this is garage belongs to Timmy_Hernandez."); } return 1; }